-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
filesystemUnderlying file system and functions that use itUnderlying file system and functions that use it
Description
Right now, you can do:
julia> open("/Users/jakobnissen/Documents/") do file
read(file)
end
0-element Array{UInt8,1}
That doesn't make much sense to me - presumably, attempting to read a directory is always a mistake, so we may as well error there. In fact, I discovered this because I accidentally read a directory and couldn't figure out why my program didn't give any output!
As a sanity check, Python refuses to do this:
>>> f = open("/Users/jakobnissen/Documents")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IsADirectoryError: [Errno 21] Is a directory: '/Users/jakobnissen/Documents'
johnnychen94, philfuchs, beddalumia, g-adel, ParadaCarleton and 3 more
Metadata
Metadata
Assignees
Labels
filesystemUnderlying file system and functions that use itUnderlying file system and functions that use it