Skip to content

paulrobello/ParFuse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParFuse FS is an example in memory filesystem written in Typescript that attempts to implement all Fuse callbacks implemented by the fuse-friends/fuse-native package.

Note for custom INode, Devices file types, or SUID to work you must use my fork of the fuse-native package and run as a privileged user.

My fork also has support for WinFsp copied from SandruSebastian/fuse-native.

This filesystem implements very basic INode and file descriptor tracking.

General utilities are located in utils.ts. Fuse or filesystem related items are in fuseUtils.ts. Fortune example items
are located in fortune.ts. The main entry point is index.ts.

This project attempts to mount the filesystem on mnt in the same folder as the running script. There is an option to auto create the folder if it does not exist.

The system will allow up to 75% of available NodeJs heap memory to be used by files. It simulates blocks as 4KB blocks which is the minimum any nonempty file will occupy.

ParFuse also has a mechanism to issue commands to the filesystem by writing to /proc/cmd. Contents in /proc/cmd are processed line by line.

Current supported commands are:

  • delay timeMs will delay execution of the next commands for timeMs milliseconds.
  • newFortune will create or overwrite the file named fortune in the root of the fs with a random quote obtained from ruanyf/fortunes

There are some helper functions named mntChroot and unmountChroot that will handle mounting the needed folders from the host onto the ParFuse fs to allow you to chroot into the virtual filesystem and run things such as bash. You must be using a privileged user to use these functions.

Most files in this project have a debugLevel const at the top of the file which will when set to 'trace' will enable lots of debug output. Trace mode is set by an environment variable named "trace" being set to "1".

Have fun and please give feedback!

License

This content is released under the (http://opensource.org/licenses/MIT) MIT License.

About

NodeJs in memory Fuse filesystem written in Typescript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published