Skip to content

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

Description

@vlsi

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.

Activity

  1. arunsrinivasan commented on Jan 3, 2015

    @arunsrinivasan
    Member

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

  2. scottgrimes commented on Jul 14, 2015

    @scottgrimes

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

  3. MichaelChirico commented on Sep 27, 2015

    @MichaelChirico
    Member

    Is checking this equivalent to finding 0 MB file?

  4. jangorecki commented on Sep 27, 2015

    @jangorecki
    Member

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

  5. MichaelChirico commented on Sep 27, 2015

    @MichaelChirico
    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.

  6. jangorecki commented on Sep 27, 2015

    @jangorecki
    Member

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

  7. MichaelChirico commented on Sep 27, 2015

    @MichaelChirico
    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)

  8. added this to the v1.9.8 milestone on Mar 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions