Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read() vs. vectorized read()? #10722

Closed
quinnj opened this issue Apr 2, 2015 · 2 comments
Closed

read() vs. vectorized read()? #10722

quinnj opened this issue Apr 2, 2015 · 2 comments

Comments

@quinnj
Copy link
Member

quinnj commented Apr 2, 2015

Is this right?

In  [14]:     f = open(fullpath)

Out [14]: IOStream(<file /Users/jacobquinn/domo/curse/data9.csv>)

In  [15]:     buf = read(f,Char,2^14)

Out [15]: 16384-element Array{Char,1}:
 '\U6d697422'
 '\U61747365'
 '\U2c22706d'
 '\U756f6322'
 '\U7972746e'
 '\U72222c22'
 '\U6f696765'
 '\U222c226e'
 '\U5f616d64'
 '\U2c226469'
 '\U74696322'
 '\U64695f79'
 '\U67222c22'
            
 '\U32312d33'
 '\U3a343020'
 '\U303a3431'
 '\U222c2233'
 '\U2c225552'
 '\U6d656b22'
 '\U36222c22'
 '\U30303334'
 '\U222c2235'
 '\U36343537'
 '\U30372c22'
 '\U31382c30'

In  [16]:     f = open(fullpath)

Out [16]: IOStream(<file /Users/jacobquinn/domo/curse/data9.csv>)

In  [17]: buf = Array(Char,2^14)
    for i = 1:2^14
        buf[i] = read(f,Char)
    end

In  [18]: buf

Out [18]: 16384-element Array{Char,1}:
 '"'
 't'
 'i'
 'm'
 'e'
 's'
 't'
 'a'
 'm'
 'p'
 '"'
 ','
 '"'
   
 '9'
 '4'
 '6'
 '9'
 'b'
 'e'
 'b'
 'd'
 '7'
 '3'
 '7'
 '5'

In  [19]: 

Peeking at the source seems to suggest they should be identical?

@mbauman
Copy link
Sponsor Member

mbauman commented Apr 2, 2015

This is #6466.

@mbauman mbauman closed this as completed Apr 2, 2015
@quinnj
Copy link
Member Author

quinnj commented Apr 2, 2015

Ah, thanks @mbauman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants