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

Misleading error when trying to do fread("folder") #989

Closed
vlsi opened this issue Dec 18, 2014 · 7 comments
Closed

Misleading error when trying to do fread("folder") #989

vlsi opened this issue Dec 18, 2014 · 7 comments
Assignees
Milestone

Comments

@vlsi
Copy link

vlsi commented Dec 18, 2014

If trying to fread("folder") a misleading error occurs:

>fread("~")
Error in fread("~") : 
  Opened file ok, obtained its size on disk (0.0MB), but couldn't memory map it.
This is a 64bit machine so this is surprising. Please report to datatable-help

I guess the error can be improved for such case.

@arunsrinivasan
Copy link
Member

Thanks for the report. Reproducible. Please make sure you've read the contribution guidelines.

@scottgrimes
Copy link

I got the same error. Any developments on fixing it?

@MichaelChirico
Copy link
Member

Is checking this equivalent to finding 0 MB file?

@jangorecki
Copy link
Member

@MichaelChirico Not sure, but I think they may refer to fread on directory.

@MichaelChirico
Copy link
Member

@jangorecki yes, I'm wondering if we have to do anything more complicated then adding an if size = 0 print("this is a directory") approach.

@jangorecki
Copy link
Member

better then relying of size would be to use file.info("path")$isdir

@MichaelChirico
Copy link
Member

@jangorecki better than going in base would (could?) be to attack this as the internals of file.info do:

LOGICAL(isdir)[i] = (sb.st_mode & S_IFDIR) > 0;

(though to be honest I don't understand how the RHS of that code works)

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

No branches or pull requests

5 participants