Asynchronously gets info about a file.

The returned object has the following properties:

  • size – size of file
  • exists – a boolean value stating whether file exists
  • lastWriteTime – A Date stating when file was last changed
  • lastAccessTime – A Date stating when file was accessed

Example

var FileSystem = require("FuseJS/FileSystem");

FileSystem.writeTextToFileSync("some-file.txt", "hello there");
FileSystem.getFileInfo("some-file.txt")
    .then(function(fileInfo) {
        console.log("file was modified on " + fileInfo.lastWriteTime);
    })
    .catch(function(error) {
        "failed stat " + error
    });

Location

Namespace
Fuse.FileSystem
Package
Fuse.FileSystem 1.9.0

Returns

Promise

A Promise of an object containing info about the file.