@gyselroth/windows-fsstat

0.0.7 • Public • Published

node-windows-fsstat

Build status npm GitHub release GitHub license

Alternative fs.lstatSync(path) for windows based systems. Since Windows does not have inodes and the node fs module provides only an inode property which is a converted integer from the 64bit fileId (Windows equal to posix inode) integer. But commonly known javascript can not handle 64bit integer, therefore the conversion into an integer can cause inode collisions which can be fatal. There is absolutely no reason that inode must be an integer. An inode or fileId is just an identifier and can be anything. Therefore this module provides besides the attribute "ino" an attribute called "fileid" which is a HEX representation (string) of the windows fileId.

See node issue #12115 for further information.

This issue has been fixed by PR #20220 (BigInt support) but has only been merged into node.js release >= v10.5.0. If you need to stick with a lower node version for any reason and still need unique inode numbers on Windows go with this package instead.

Install

npm install --save @gyselroth/windows-fsstat

Usage

var windowsFs = require('@gyselroth/windows-fsstat');
console.log(windowsFs.lstatSync('C:\\windows'));

{ fileid: '0x00020000000070FD',
  ino: 562949953450237,
  size: 0,
  atime: 2017-08-07T06:58:53.000Z,
  mtime: 2017-08-07T06:58:53.000Z,
  ctime: 2017-03-18T11:40:20.000Z,
  directory: true,
  symbolicLink: false }

Package Sidebar

Install

npm i @gyselroth/windows-fsstat

Weekly Downloads

2

Version

0.0.7

License

MIT

Unpacked Size

7.94 MB

Total Files

54

Last publish

Collaborators

  • laura.kohli
  • dragan.jevdjovic
  • dragoljub.popovic
  • ovidio.raimondi
  • ewald.kleefstra
  • mahmoud.sino
  • marius.weber
  • pixtron
  • npm-gyselroth
  • mmhann
  • philippenahlik
  • grfreelancer1
  • grfreelancer2
  • luca.marra
  • s-aebischer