Socket
Socket
Sign inDemoInstall

fstree

Package Overview
Dependencies
3
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fstree

recursive filesystem operations


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
104 kB
Created
Weekly downloads
 

Readme

Source

fstree: recursive filesystem functions

There are plenty of modules for doing recursive filesystem operations. These have slightly different semantics than the ones I saw previously.

This module provides three main functions:

copyTree(src, dst, callback): recursively copies "src" to "dst"

This behaves much like "cp -R", except that only regular files, symlinks, and directories are supported (not pipes or devices). Like "cp", this operation fails if the destination already exists. If any part of the operation fails, the partial copy will still be present.

This implementation will only allow 100 outstanding filesystem operations at a time. If you need more, you can bump cpMaxWorkers, but beware of system resource limits (e.g., file descriptors).

rmTree(dir, callback): recursively remove an entire directory tree

This behaves much like "rm -r". Unlike copyTree, this one does not attempt to limit the number of outstanding filesystem operations, but it also doesn't use a file descriptor per file in the tree.

mountLofs(source, dest, callback): create a read-only lofs mount

On illumos systems, this creates a read-only lofs mount of "source" at "dest". This just calls the underlying mount(1M) command.

FAQs

Last updated on 18 Apr 2012

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc