Giter Club home page Giter Club logo

fuse4js's Introduction

Fuse4js

Fuse4js provides Javascript bindings to the FUSE subsystem of Linux. It enables you to develop user-space file systems with node.js.

Requirements

Linux:

  • Fuse4js has been tested on Ubuntu 10.04, Ubuntu 12.04 and CentOS 5.x (all 32-bit).
  • GNU Compiler toolchain, including gcc and g++
    • On Ubuntu: sudo apt-get install g++
  • FUSE library and header files.
    • On Ubuntu: sudo apt-get install libfuse-dev
    • On CentOS / RedHat: yum install fuse-devel
  • pkg-config tool (typically included out-of-the-box with the OS)
  • node.js 0.8.7 or later

OSX:

Tutorial

This tutorial explains how to install and use fuse4js.

  • Ensure your system meets the software requirements listed above.
  • Create a /tmp/tutorial directory.
  • cd to the directory you created.
  • Create a mnt/ subdirectory. It will be used as the mount point for testing FUSE file systems.
  • Download the fuse4js/ source directory: git clone git://github.com/vmware/fuse4js.git
  • Compile the source code to create the fuse4js add-on in a local node_modules/ subdirectory:
    npm install fuse4js
  • Run the sample jsonFS file system:
    node fuse4js/example/jsonFS.js fuse4js/example/sample.json /tmp/tutorial/mnt
    This mounts the JSON file as a file system. In a another shell, you can browse and make changes to the file system under /tmp/tutorial/mnt. You can view, edit, create, and move files and directories.
  • To dismount, make sure no processes remain under the file system path, and then type: fusermount -u /tmp/tutorial/mnt
  • Changes to the file system are discarded. If you want to save the modified data to a new JSON file, add the -o outputJsonFilePath option when starting the program.

Once you are comfortable with the sample program, you can move on to the second example, mirrorFS.js. It is equivalent to the fusexmp.c sample program that ships with the FUSE source code. As its name indicates, it maps an existing file system subtree to a mount point of your choice. It demonstrates more advanced features such as file handles. The syntax is: node fuse4js/example/mirrorFS.js <file_system_directory> <new_mount_point>

Global installation

The tutorial used a local installation of fuse4js that is private to the /tmp/tutorial directory. To install fuse4js globally on your system:

  • Log in as root, or use sudo
  • Download the source code into a fuse4js/ subdirectory
  • Install by typing: npm install -g --unsafe-perm fuse4js
    The --unsafe-perm option seems to be necessary to work around an interference between the node-gyp compilation process and npm's downgrading of permissions when running a package's installation script (you may get an EACCES error without it)
  • At this point, the add-on should be installed under /usr/local/lib/node_modules. To use it in your programs using a statement such as fuse4js = require("fuse4js"), include /usr/local/lib/node_modules in your NODE_PATH environment variable. By default, node.js doesn't look in there for some reason, despite the fact that npm uses that directory as the default global installation location. Example: export NODE_PATH=/usr/local/lib/node_modules

Installation from NPM registry

As of September 17, 2012, fuse4js has been added to the NPM registry, so you can skip the git download step and install it directly by typing:
npm install fuse4js
This will put the module under a local node_modules/ subdirectory.

API Documentation

Fuse4js currently implements a subset of all FUSE file operations. More will be added over time, but the initial set is sufficient to implement a basic read/write file system.

You implement a file system by registering Javascript handler functions with fuse4js. Each handler handles a particular FUSE operation. While the arguments passed to a handler vary depending on the requested operation, the last argument is always a callback function that you invoke when you are finished servicing the request. The arguments to the callback typically include an error code, followed by zero or more additional arguments depending on the FUSE operation. Following FUSE conventions, the error code is set to a negated 'errno' value to indicate error, and zero or a positive value (for read/write operations) to indicate success.

We currently don't have a separate document describing the Javascript interface corresponding to each FUSE operation. Instead, the API is documented in the comments for each handler in the mirrorFS.js sample program, so use that as the reference for now.

How it Works

The FUSE event loop runs in its own thread, and communicates with the node.js main thread using an RPC mechanism based on a libuv async object and a semaphore. There are a couple of context switches per FUSE system call. Read/Write operations also involve a copy operation via a node.js Buffer object.

ToDo List

  • Automated tests
  • Support for more FUSE operations, such as hard link management.
  • Improve performance (try to reduce context switches and copy operations)

License

Fuse4js is released under the terms of the MIT license. See the LICENSE.txt file for details.

Contributing

If you wish to submit code changes to this repository, please request a contribution agreement form from the maintainer (VMware legal requires it).

Contact

Feel free to send bug reports and constructive feedback to the maintainer: [email protected]

fuse4js's People

Contributors

bcle avatar duralog avatar elwerene avatar ericthemagician avatar gierschv avatar mafintosh avatar sarakusha avatar seanewest avatar sidorares avatar thejh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fuse4js's Issues

chmod() doesn't pass a callback function?

I'm getting strange behavior when trying to implement the chmod() function. It only gets passed 2 arguments it seems, the path and mode. But the callback function (expected as 3rd argument) is not there! See log:

  s3fs GETATTR: path='/' key='/' +3s
  s3fs GETATTR: path='/cron.sh' key='/cron.sh' +1ms
  s3fs GETATTR: path='/cron.sh' key='/cron.sh' +66ms
{ '0': '/cron.sh', '1': 33261 }
  s3fs CHMOD: path='/cron.sh' mode=33261 +61ms
chmod() does not pass a cb() function... wtf

Where the code looks something like this (basically a no-op, just with some logging):

function chmod(path, mode, cb) {
  console.error(arguments);
  debug('CHMOD: path=%o mode=%o', path, mode);

  if (cb)
    return cb(0);
  else
    console.error('chmod() does not pass a cb() function... wtf');
}

Any idea what's going on here? Thanks in advance.

/cc @gierschv @bcle

Running jsonFS doesn't work on ubuntu 12.04 LTS x86-64

This is my dev environment. Looks like the setxattr/statfs changes caused this, since it works if I revert back to commit 65395cb.

Here's the output:

ubuntu@ip-10-171-45-167:/tmp/tutorial$ node fuse4js/example/jsonFS.js fuse4js/example/sample.json /tmp/tutorial/mnt

Input file: fuse4js/example/sample.json
Mount point: /tmp/tutorial/mnt
File system stopped

Mounting external Webdav source.

Hi,

In your documentation, can you give as some examples for common uses like "Mounting external WebDAV server", and/or "Mounting external storage (e.g. Google drive, DropBox, UbuntuOne, Amazon S3, etc) and/or even better "Building a Unified Web Storage filesystem using fuse4js".

Thank you in advance. (I'm traditional [mounts only by root] guy. First time mouting from within application. Hope you understand). Thank you.

unmount support

Great job on this module!

Is there anyway to programmatically unmount a fuse4js filesystem after I have called start?

Not compiling on most recent Node.JS

Hi,

I have tried compiling on v0.11.13 and would not compile due to errors.

I then tried v0.8.7 which compiled fine without warnings.

I then tried v0.10.29 which compiled and worked with warnings.
Now using node v0.10.29

Error while using v0.11.13

ubuntu@ajw:~/fuseTest2$ npm install fuse4js
npm http GET https://registry.npmjs.org/fuse4js
npm http 304 https://registry.npmjs.org/fuse4js

> [email protected] install /home/ubuntu/fuseTest2/node_modules/fuse4js
> node-gyp rebuild

make: Entering directory `/home/ubuntu/fuseTest2/node_modules/fuse4js/build'
  CXX(target) Release/obj.target/fuse4js/fuse4js.o
../fuse4js.cc:60:3: error: ‘uv_async_t’ does not name a type
   uv_async_t async;
   ^
../fuse4js.cc: In function ‘int f4js_rpc(fuseop_t, const char*)’:
../fuse4js.cc:185:23: error: ‘struct’ has no member named ‘async’
   uv_async_send(&f4js.async);
                       ^
../fuse4js.cc:185:28: error: ‘uv_async_send’ was not declared in this scope
   uv_async_send(&f4js.async);
                            ^
../fuse4js.cc: In function ‘void* fuse_thread(void*)’:
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::readlink’ [-Wmissing-field-initializers]
   struct fuse_operations ops = { 0 };
                                    ^
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::getdir’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::mknod’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::mkdir’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::unlink’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::rmdir’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::symlink’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::rename’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::link’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::chmod’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::chown’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::truncate’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::utime’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::open’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::read’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::write’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::statfs’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::flush’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::release’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::fsync’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::setxattr’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::getxattr’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::listxattr’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::removexattr’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::opendir’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::readdir’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::releasedir’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::fsyncdir’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::init’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::destroy’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::access’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::create’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::ftruncate’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::fgetattr’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::lock’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::utimens’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::bmap’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::flag_nullpath_ok’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::flag_nopath’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::flag_utime_omit_ok’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::flag_reserved’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::ioctl’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::poll’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::write_buf’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::read_buf’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::flock’ [-Wmissing-field-initializers]
../fuse4js.cc:376:36: warning: missing initializer for member ‘fuse_operations::fallocate’ [-Wmissing-field-initializers]
../fuse4js.cc: In function ‘void ConvertDate(v8::Handle&, std::string, timespec*)’:
../fuse4js.cc:416:33: error: ‘NewSymbol’ is not a member of ‘v8::String’
   Local prop = stat->Get(String::NewSymbol(name.c_str()));
                                 ^
../fuse4js.cc: At global scope:
../fuse4js.cc:431:31: error: ‘Arguments’ does not name a type
 void ProcessReturnValue(const Arguments& args)
                               ^
../fuse4js.cc:431:42: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 void ProcessReturnValue(const Arguments& args)
                                          ^
../fuse4js.cc: In function ‘void ProcessReturnValue(const int&)’:
../fuse4js.cc:433:12: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (args.Length() >= 1 && args[0]->IsNumber()) {
            ^
../fuse4js.cc:433:35: error: invalid types ‘const int[int]’ for array subscript
   if (args.Length() >= 1 && args[0]->IsNumber()) {
                                   ^
../fuse4js.cc:434:54: error: invalid types ‘const int[int]’ for array subscript
     Local retval = Local::Cast(args[0]);
                                                      ^
../fuse4js.cc: At global scope:
../fuse4js.cc:441:39: error: ‘Arguments’ does not name a type
 Handle GetAttrCompletion(const Arguments& args)
                                       ^
../fuse4js.cc:441:50: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle GetAttrCompletion(const Arguments& args)
                                                  ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle GetAttrCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:443:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:445:36: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsObject()) {
                                    ^
../fuse4js.cc:445:59: error: invalid types ‘const int[int]’ for array subscript
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsObject()) {
                                                           ^
../fuse4js.cc:447:54: error: invalid types ‘const int[int]’ for array subscript
     Handle stat = Handle::Cast(args[1]);
                                                      ^
../fuse4js.cc:449:35: error: ‘NewSymbol’ is not a member of ‘v8::String’
     Local prop = stat->Get(String::NewSymbol("size"));
                                   ^
../fuse4js.cc:455:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("mode"));
                      ^
../fuse4js.cc:461:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("nlink"));
                      ^
../fuse4js.cc:467:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("uid"));
                      ^
../fuse4js.cc:473:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("gid"));
                      ^
../fuse4js.cc:492:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:492:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:497:39: error: ‘Arguments’ does not name a type
 Handle ReadDirCompletion(const Arguments& args)
                                       ^
../fuse4js.cc:497:50: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle ReadDirCompletion(const Arguments& args)
                                                  ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle ReadDirCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:499:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:501:36: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsArray()) {
                                    ^
../fuse4js.cc:501:59: error: invalid types ‘const int[int]’ for array subscript
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsArray()) {
                                                           ^
../fuse4js.cc:502:50: error: invalid types ‘const int[int]’ for array subscript
     Handle ar = Handle::Cast(args[1]);
                                                  ^
../fuse4js.cc:516:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:516:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:521:38: error: ‘Arguments’ does not name a type
 Handle StatfsCompletion(const Arguments& args)
                                      ^
../fuse4js.cc:521:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle StatfsCompletion(const Arguments& args)
                                                 ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle StatfsCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:523:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:525:36: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsObject()) {
                                    ^
../fuse4js.cc:525:59: error: invalid types ‘const int[int]’ for array subscript
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsObject()) {
                                                           ^
../fuse4js.cc:527:54: error: invalid types ‘const int[int]’ for array subscript
     Handle stat = Handle::Cast(args[1]);
                                                      ^
../fuse4js.cc:529:35: error: ‘NewSymbol’ is not a member of ‘v8::String’
     Local prop = stat->Get(String::NewSymbol("bsize"));
                                   ^
../fuse4js.cc:535:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("frsize"));
                      ^
../fuse4js.cc:541:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("blocks"));
                      ^
../fuse4js.cc:547:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("bfree"));
                      ^
../fuse4js.cc:553:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("bavail"));
                      ^
../fuse4js.cc:559:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("files"));
                      ^
../fuse4js.cc:565:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("ffree"));
                      ^
../fuse4js.cc:571:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("favail"));
                      ^
../fuse4js.cc:577:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("fsid"));
                      ^
../fuse4js.cc:583:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("flag"));
                      ^
../fuse4js.cc:589:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
     prop = stat->Get(String::NewSymbol("namemax"));
                      ^
../fuse4js.cc:596:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:596:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:601:40: error: ‘Arguments’ does not name a type
 Handle ReadLinkCompletion(const Arguments& args)
                                        ^
../fuse4js.cc:601:51: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle ReadLinkCompletion(const Arguments& args)
                                                   ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle ReadLinkCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:603:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:605:36: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsString()) {
                                    ^
../fuse4js.cc:605:59: error: invalid types ‘const int[int]’ for array subscript
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsString()) {
                                                           ^
../fuse4js.cc:606:32: error: invalid types ‘const int[int]’ for array subscript
     String::Utf8Value av(args[1]);
                                ^
../fuse4js.cc:613:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:613:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:618:39: error: ‘Arguments’ does not name a type
 Handle GenericCompletion(const Arguments& args)
                                       ^
../fuse4js.cc:618:50: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle GenericCompletion(const Arguments& args)
                                                  ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle GenericCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:620:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:627:15: error: ‘uv_handle_t’ was not declared in this scope
     uv_unref((uv_handle_t*) &f4js.async);
               ^
../fuse4js.cc:627:27: error: expected primary-expression before ‘)’ token
     uv_unref((uv_handle_t*) &f4js.async);
                           ^
../fuse4js.cc:627:35: error: ‘struct’ has no member named ‘async’
     uv_unref((uv_handle_t*) &f4js.async);
                                   ^
../fuse4js.cc:627:40: error: ‘uv_unref’ was not declared in this scope
     uv_unref((uv_handle_t*) &f4js.async);
                                        ^
../fuse4js.cc:631:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:631:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:636:42: error: ‘Arguments’ does not name a type
 Handle OpenCreateCompletion(const Arguments& args)
                                          ^
../fuse4js.cc:636:53: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle OpenCreateCompletion(const Arguments& args)
                                                     ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle OpenCreateCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:638:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:640:36: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsNumber()) {
                                    ^
../fuse4js.cc:640:59: error: invalid types ‘const int[int]’ for array subscript
   if (f4js_cmd.retval == 0 && args.Length() >= 2 && args[1]->IsNumber()) {
                                                           ^
../fuse4js.cc:641:58: error: invalid types ‘const int[int]’ for array subscript
     Local fileHandle = Local::Cast(args[1]);
                                                          ^
../fuse4js.cc:647:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:647:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:652:36: error: ‘Arguments’ does not name a type
 Handle ReadCompletion(const Arguments& args)
                                    ^
../fuse4js.cc:652:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle ReadCompletion(const Arguments& args)
                                               ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle ReadCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:654:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:657:59: error: no matching function for call to ‘Data(v8::Persistent&)’
     char *buffer_data = node::Buffer::Data(f4js.nodeBuffer);
                                                           ^
../fuse4js.cc:657:59: note: candidates are:
In file included from ../fuse4js.cc:24:0:
/home/ubuntu/.node-gyp/0.11.13/src/node_buffer.h:40:19: note: char* node::Buffer::Data(v8::Handle)
 NODE_EXTERN char* Data(v8::Handle val);
                   ^
/home/ubuntu/.node-gyp/0.11.13/src/node_buffer.h:40:19: note:   no known conversion for argument 1 from ‘v8::Persistent’ to ‘v8::Handle’
/home/ubuntu/.node-gyp/0.11.13/src/node_buffer.h:41:19: note: char* node::Buffer::Data(v8::Handle)
 NODE_EXTERN char* Data(v8::Handle val);
                   ^
/home/ubuntu/.node-gyp/0.11.13/src/node_buffer.h:41:19: note:   no known conversion for argument 1 from ‘v8::Persistent’ to ‘v8::Handle’
../fuse4js.cc:663:19: error: ‘class v8::Persistent’ has no member named ‘Dispose’
   f4js.nodeBuffer.Dispose();
                   ^
../fuse4js.cc:665:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:665:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:670:37: error: ‘Arguments’ does not name a type
 Handle WriteCompletion(const Arguments& args)
                                     ^
../fuse4js.cc:670:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
 Handle WriteCompletion(const Arguments& args)
                                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h: In function ‘v8::Handle WriteCompletion(const int&)’:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:845:13: error: ‘v8::HandleScope::HandleScope()’ is protected
   V8_INLINE HandleScope() {}
             ^
../fuse4js.cc:672:15: error: within this context
   HandleScope scope;
               ^
../fuse4js.cc:674:19: error: ‘class v8::Persistent’ has no member named ‘Dispose’
   f4js.nodeBuffer.Dispose();
                   ^
../fuse4js.cc:676:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
   return scope.Close(Undefined());
                ^
../fuse4js.cc:676:32: error: too few arguments to function ‘v8::Handle v8::Undefined(v8::Isolate*)’
   return scope.Close(Undefined());
                                ^
In file included from /home/ubuntu/.node-gyp/0.11.13/src/node.h:61:0,
                 from ../fuse4js.cc:23:
/home/ubuntu/.node-gyp/0.11.13/deps/v8/include/v8.h:336:28: note: declared here
   friend Handle Undefined(Isolate* isolate);
                            ^
../fuse4js.cc: At global scope:
../fuse4js.cc:682:24: error: variable or field ‘DispatchOp’ declared void
 static void DispatchOp(uv_async_t* handle, int status)
                        ^
../fuse4js.cc:682:24: error: ‘uv_async_t’ was not declared in this scope
../fuse4js.cc:682:36: error: ‘handle’ was not declared in this scope
 static void DispatchOp(uv_async_t* handle, int status)
                                    ^
../fuse4js.cc:682:44: error: expected primary-expression before ‘int’
 static void DispatchOp(uv_async_t* handle, int status)
                                            ^
../fuse4js.cc: In function ‘v8::Handle GetAttrCompletion(const int&)’:
../fuse4js.cc:493:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../fuse4js.cc: In function ‘v8::Handle ReadDirCompletion(const int&)’:
../fuse4js.cc:517:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../fuse4js.cc: In function ‘v8::Handle StatfsCompletion(const int&)’:
../fuse4js.cc:597:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../fuse4js.cc: In function ‘v8::Handle ReadLinkCompletion(const int&)’:
../fuse4js.cc:614:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../fuse4js.cc: In function ‘v8::Handle GenericCompletion(const int&)’:
../fuse4js.cc:632:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../fuse4js.cc: In function ‘v8::Handle OpenCreateCompletion(const int&)’:
../fuse4js.cc:648:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../fuse4js.cc: In function ‘v8::Handle ReadCompletion(const int&)’:
../fuse4js.cc:666:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
../fuse4js.cc: In function ‘v8::Handle WriteCompletion(const int&)’:
../fuse4js.cc:677:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Release/obj.target/fuse4js/fuse4js.o] Error 1
make: Leaving directory`/home/ubuntu/fuseTest2/node_modules/fuse4js/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/ubuntu/.nvm/v0.11.13/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1046:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/home/ubuntu/.nvm/v0.11.13/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/fuseTest2/node_modules/fuse4js
gyp ERR! node -v v0.11.13
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the fuse4js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls fuse4js
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/home/ubuntu/.nvm/v0.11.13/bin/node" "/home/ubuntu/.nvm/v0.11.13/bin/npm" "install" "fuse4js"
npm ERR! cwd /home/ubuntu/fuseTest2
npm ERR! node -v v0.11.13
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ubuntu/fuseTest2/npm-debug.log
npm ERR! not ok code 0


I do not yet know enough about native node.js extensions to know where to even start.
Kind Regards
Adam

Cannot install on Mac OS 10.10

Try to install on Mac but it will during node-gyp rebuild:

> [email protected] install /Users/ferrari/Programming/resources/fuse4js
> node-gyp rebuild

  CXX(target) Release/obj.target/fuse4js/fuse4js.o
../fuse4js.cc:364:36: warning: missing field 'readlink' initializer [-Wmissing-field-initializers]
  struct fuse_operations ops = { 0 };
                                   ^
1 warning generated.
  SOLINK_MODULE(target) Release/fuse4js.node
ld: library not found for -losxfuse
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/fuse4js.node] Error 1

But I already installed osxfuse 2.7.2 first, but seem it cannot identity?
Not sure is this fail because osx 10.10 or other reason.
Any advice? Thanks

`allow_other` option support

385 // even...
386 ...
387 const char* debugOption = f4js.enableFuseDebug? "-d":"-f";
388 char *argv[] = { (char*)"dummy", (char*)"-s", (char*)"-o", (char*)"allow_other", (char*)debugOption, (char*)f4js.root.c_str() };
389 ...

Compilation fails on CentOS 6.5 with nodejs-0.10.33-1.el6.x86_64 and fuse-devel-2.8.3-4.el6.x86_64

npm install fuse4js
npm http GET https://registry.npmjs.org/fuse4js
npm http 304 https://registry.npmjs.org/fuse4js
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan

[email protected] install /tmp/node_modules/fuse4js
node-gyp rebuild

make: Entering directory /tmp/node_modules/fuse4js/build' CXX(target) Release/obj.target/fuse4js/fuse4js.o ../fuse4js.cc: In function \u2018void* fuse_thread(void*)\u2019: ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::readlink\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::getdir\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::mknod\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::mkdir\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::unlink\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::rmdir\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::symlink\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::rename\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::link\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::chmod\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::chown\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::truncate\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::utime\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::open\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::read\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::write\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::statfs\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::flush\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::release\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::fsync\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::setxattr\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::getxattr\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::listxattr\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::removexattr\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::opendir\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::readdir\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::releasedir\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::fsyncdir\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::init\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::destroy\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::access\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::create\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::ftruncate\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::fgetattr\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::lock\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::utimens\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::bmap\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::flag_nullpath_ok\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::flag_reserved\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::ioctl\u2019 ../fuse4js.cc:384: warning: missing initializer for member \u2018fuse_operations::poll\u2019 ../fuse4js.cc: In function \u2018v8::Handle<v8::Value> ProcessReturnValue(const v8::Arguments&)\u2019: ../fuse4js.cc:446: warning: no return statement in function returning non-void ../fuse4js.cc: In function \u2018void DispatchOp(uv_async_t*, int)\u2019: ../fuse4js.cc:803: error: return-statement with a value, in function returning 'void' make: *** [Release/obj.target/fuse4js/fuse4js.o] Error 1 make: Leaving directory/tmp/node_modules/fuse4js/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 2.6.32-504.8.1.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/node_modules/fuse4js
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

publish latest stable changes

I just noticed that latest published version is more than 3 month old and my code already depends on readlink support. Could you please bump version & publish?

fuse_get_context()

I have a personal preference because of familiarity for nodejs, but the fuse binding seems to be missing one critical function: fuse_get_context(). I can't find it anywhere in the binding.

This is what the python binding has:

https://code.google.com/p/fusepy/source/browse/trunk/context.py

uid, gid, pid = fuse_get_context()

I really need this feature, but I would not want to move the entire project to Python just for this one missing function. Is there a reason why it could be added? That would spare me from trying to do it by myself ;-)

Issue with large file sizes

I have a virtual file that is 3,472,655,443 bytes long and I set the stat.size to this length in the getattr handler. I believe it is in a javascript Number object which should be able to handle up to 53 bit numbers or 9,007,199,254,740,992.

The operating system (Ubuntu Server 14.04) is reporting a file size of 18,446,744,072,887,239,763 when doing a 'ls -l' on the directory holding the file.

I also have this directory shared to windows (over samba) which reports the file size as -822,311,853 bytes.

There is something weird going on here that smells a lot like the number being marshaled into too small of a container in the fuse4js code.

Segfault in node 0.10.31

With the following JS file, I get a segfault using latest stable node and [email protected] from npm.

var inflate = require('pako').inflate;

var input = "eJy9VU1vGzcQve+vGDiH2Khk3XoIUh/ipomKpIc4rVEEBUQtR1paXA5Lcq3o3/cNKclqf0B9MFbkfLx582ZY2LoyNzF2P53+uu6rHpLLZGiLj7XJbMnyM3uJI4dCHJ5dkqDft0SPAwdaUjaHC/MljWwCHWTqrITX8NGYG+c5kwSyLu/g+qdM7UIdrSlGnTNuE/fFH2Dxh8uT8f5AMPAiu9yNUz+QdzsGvJIMvJ0E42scSdTLGD0Xpr0rQ00IK4ZxsCeTaAIj9O/BcurKwDSI2JliJZOY1kn22YUt6dUlMNomE4caqU9sitoE3lMQC9B63E3RtnP1TSKFEm84cegBCDyBxFQTjaYW0A8mbPkWnMM+TikK0siGzi0o0nKp8WULojdlI2lEIlNqtEwxCRCOI/J3v5pn89AnF8G8yYeKbhRUZ/qeczZrrxQsgW8KGYUhhfblfkgy8jslurpkkaAUJeXTe1orjkFyQYv3vCaUk0F/Q1FD4ccoa6W98oh7PSqasGQUugy5oKEEe+WoJaRvjwj2gObwX9dDKTG/WSz6enW7FdkCLPq6QMasNgvLxTi/KFW9F7TMj8pciPDOuqd1WK+f7OZJeuM2Pjwh1hDWfru56bpXr+ij6XfaLACshHfdg9TuWO6dRYn6vTegG20Y2EeImtaT8xbYdT72nBV9EfFg8ytIeH0kE5X+4lIuM7qYpsx+M1f2NKkKFTQlWpx0uTh3tQaDi85QrkMUGHBaKGBpGOpPmH4Q2nKjs3FGlaVzc9ymFjKYZ8YkdsYDoD0AYRsuVOh3BY7TdnhDb8/0e5nsFCvx/f3n3z4+2fv9j3/fdR3NadlCttHWwG1XDNMa8HbYB9C1PcxetKtzIoG17ecMzaEmyFyUlLyo3nkB8zvN88lMAeOupX2LiedaeDkXdhqU/0kzdSKm82roJRT+juHjMNF1ctuhzHvv+t0NOZ0I7oiIx1gOdeNo39TN8waqgBSw4ujqkwN3n2WCxj40/r5wlCut/T3CJ1q1VSPBfT9ix7Ze0bXUPZIIctmdOlyluk+unMb8hAR7EFrEf4ZstIpoMMItQOvX0c7j/FaTf6nl3Gs5dX5xt2rktvwb8dieJzft7nnL/qu099+jpKrZn7Hyr2rsh2ZggCLpLjvGul6C3LbsLcw574rERjr0YyBr1FrTFZNU8HCo78Cq8rK6qcEfTTkKJqssHbpEOQLnftClhPnhCikfedEHCejqg1T99TWDrnlGEvm0EdXkbasfKkPXIVL0JN/N8BjqbjstZ9Qx4jmYNdjW1iwtIwb4WKnR5UpTiNg/OD2Hu/2P5Ld4MJJRxwvFl+PUL/G0QOBQn23PyIsuPXhSS10hGUbhJUCT7+oe2k3if3i3qrJkLGS4jmTQEt1dXfcPivzbTg==";
inflate(new Uint8Array(new Buffer(input, "base64")));
tim@localhost:~/Downloads/test$ node -v
v0.10.31
tim@localhost:~/Downloads/test$ node problem.js 
Segmentation fault (core dumped)

Dual Licensing

Could you consider dual licensing with BSD so that the GPL does not come into play on OSX. As it stands, any software requiring the lib will otherwise require it to licensed under the GPL. In contrast to linux, OSXFuse is under BSD Terms. Alternatively licensing under the LGPL might be an appropriate balance of both which would could also resolve its use in particular circumstances.

Feature: consider GNU LGPL

Hi,

I'm not sure if this is possible but libfuse is actually LGPL. Only the kernel module and accessories are GPL. I am hoping this will allow fuse4js to have a LGPL allowing more opensource software to use it in their projects where they foresee the end customer not wanting to give away their source.

Under what license is FUSE released?
The kernel part is released under the GNU GPL.
Libfuse is released under the GNU LGPL.
All other parts (examples, fusermount, etc) are released under the GNU GPL.

Source

Regards

Adam

is it possible to change filename on create or release?

Hi, I'm trying to change a file's extension when I create it in the mounted file system. Is this possible? If so, how should I go about doing this? I tried tweaking the create and release functions on the mirrorFS example to rename the file, but no luck. I got an endless loop between create and release when I modified the create command, and I got -43 errors when I modified the release command.

Any direction would be much appreciated. Thank you!

Compilation fails.

Hey. I've been trying to install fuse4js, however the command sudo npm install -g --unsafe-perm fuse4js results in these errors: http://pbin.in/Ze

npm version: 2.7.0
node version: 0.12.0
OS: Debian Wheezy (Linux gallifrey 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux)

Had to add statfs handler to mirrorFS example

I am running OSX v10.9.2 and the jsonFS example ran fine but the mirrorFS example was not. Using the --unsafe-perm option did not help.

Copying and pasting the statfs handler from jsonFS into mirrorFS seemed to fix it. I don't understand enough of the internals at this point to know why.

Here is the original mirrorFS debug output:

Source root: sampledir
Mount point: mymount
FUSE debugging enabled
unique: 0, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.8
flags=0x00000000
max_readahead=0x00100000
File system started at mymount
To stop it, type this in another shell: fusermount -u mymount
   INIT: 7.8
   flags=0x00000000
   max_readahead=0x00100000
   max_write=0x01000000
   unique: 0, error: 0 (Undefined error: 0), outsize: 40
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
   unique: 0, error: -1 (Operation not permitted), outsize: 16
File system stopped

Intercepting inotify watches

I'm working on a compiling proxy file system for frontend assets. The typical workflow for frontend developers involves setting up file watchers to trigger live reloading of browsers when contents of files are updated.

Watches work correctly against the fuse mount, but I have no way to intercept the setup or teardown of these watchers. In the ideal case I'd like to completely intercept the watch call, set up my own watcher against the source directory and trigger the fuse file watcher callback when needed. I would hope that I could cut the amount of inotify watchers in half that way. Also I would prefer to set up watchers on demand, given the actual usage pattern, instead of needing the developer to manually preconfigure what the fuse proxy will need to set up watchers for.

What do I need to do in order to intercept these watcher interactions with my fuse mount? I assume there might be some native bindings that have to be written, and I am willing to give that a go, but I am not even aware of what methods I would need to implement

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.