{"_id":"fsctl","_rev":"481566","name":"fsctl","description":"Series of small native fd utils for manipulating file attributes and more","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-05T09:39:35.000Z","created":"2021-02-26T15:49:55.316Z","1.0.0":"2021-02-26T16:19:46.253Z","0.0.0":"2021-02-26T15:49:55.316Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fsctl.git"},"versions":{"1.0.0":{"name":"fsctl","version":"1.0.0","description":"Series of small native fd utils for manipulating file attributes and more","main":"index.js","dependencies":{"napi-macros":"^2.0.0","node-gyp-build":"^4.2.3"},"devDependencies":{"prebuildify":"^4.1.2","tape":"^4.9.2"},"scripts":{"test":"tape test.js","prebuild":"prebuildify --napi","prebuild-ia32":"prebuildify --napi --arch=ia32","install":"node-gyp-build"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fsctl.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fsctl/issues"},"homepage":"https://github.com/mafintosh/fsctl","gitHead":"381cc5d26f081c3ae582933459929753f3a8fe79","_id":"fsctl@1.0.0","_nodeVersion":"15.7.0","_npmVersion":"6.14.11","dist":{"shasum":"6c1fdd9f11bddba23d1ff6f3bf29881b10bd5dd8","size":353867,"noattachment":false,"key":"/fsctl/-/fsctl-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fsctl/download/fsctl-1.0.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fsctl_1.0.0_1614356386039_0.5239934552360832"},"_hasShrinkwrap":false,"publish_time":1614356386253,"_cnpm_publish_time":1614356386253},"0.0.0":{"name":"fsctl","version":"0.0.0","description":"WIP - nothing to see here","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fsctl.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fsctl/issues"},"homepage":"https://github.com/mafintosh/fsctl","_id":"fsctl@0.0.0","_nodeVersion":"15.7.0","_npmVersion":"6.14.11","dist":{"shasum":"323e0a87ba74377300cca276438a359c26784463","size":1344,"noattachment":false,"key":"/fsctl/-/fsctl-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fsctl/download/fsctl-0.0.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fsctl_0.0.0_1614354594953_0.9822255345832025"},"_hasShrinkwrap":false,"publish_time":1614354595316,"_cnpm_publish_time":1614354595316}},"readme":"# fsctl\n\nSeries of small native fd utils for manipulating file attributes and more\n\n```\nnpm install fsctl\n```\n\n## Usage\n\n``` js\nconst { lock, unlock, sparse } = require('fsctl')\n\n// Can we lock the file using the fd?\nconsole.log(lock(fd))\n\n// Can we unlock it?\nconsole.log(unlock(fd))\n\n// Can we set the file as sparse?\nconsole.log(sparse(fd))\n```\n\n## API\n\n#### `bool = fsctl.lock(fd)`\n\nTry to lock access to a file using a file descriptor.\nReturns true if the file could be locked, false if not.\n\nNote that the lock is only advisory and there is nothing stopping someone from accessing the file by simply ignoring the lock.\n\nWorks across processes as well.\n\n#### `bool = fsctl.unlock(fd)`\n\nUnlocks a file if you have the lock.\n\n#### `bool = fsctl.sparse(fd)`\n\nSet the file as sparse (ie allow it to have unallocated holes)\n\n## Credits\n\nThanks to @xori for adding the sparse util.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/fsctl","bugs":{"url":"https://github.com/mafintosh/fsctl/issues"},"license":"MIT"}