June 2014
Intermediate to advanced
696 pages
38h 52m
English
Another common task is to get basic information about file system objects, such as file size, mode, modification time, whether the entry is a file or folder, etc. You can obtain such information by using one of the following calls:
fs.stat(path, callback)fs.statSync(path)
The fsStatSync() method returns a Stats object. The fs.stat() method is executed, and the Stats object is passed to the callback function as the second parameter. The first parameter is error if an error occurs.
Table 6.2 lists some of the most commonly used attributes and methods attached to the Stats object.
Table 6.2 Attributes and methods of Stats objects ...
Read now
Unlock full access