Skip to content
  • rswindell's avatar
    New global JS function: file_mode() · f1ed1c6b
    rswindell authored
    This function behaves the same as file_attrib() on *nix, but on Windows,
    file_mode() returns a *nix/stat style st_mode value (compatible with
    file_chmod) while file_attrib() returns the struct _finddata_t 'attrib' value,
    which is a quite different value (e.g. indicates Windows/DOS centric file
    attributes like "archive", "hidden", etc.) and is *incompatible* with
    file_chmod(). So if you're going to modify a file's permissions (mode), use
    file_mode() to read them and file_chmod() to save them.
    
    file_attrib() should really only be used on Windows and only for checking for
    attributes like "hidden", "archive", etc. (which don't exist on *nix).
    f1ed1c6b