mafintosh/fuse-bindings

Stale links in readme (I am making typescript definitions for this library)

Opened this issue · 7 comments

3n-mb commented

Link for mount options and FUSE api are stale and don't resolve.

Can you point me to a fresher ones? And can you tell in a few words what is a general translation from FUSE api into javascript expected types. I am making a .d.ts definitions file for this library, and I will PR it.

And, thank you for this nice library.

Can you point me to a fresher ones?

Maybe FUSE has changed its website...

And can you tell in a few words what is a general translation from FUSE api into javascript expected types.

If I correctly understood your question, just a conversion of the types from Javascript to C and viceversa, without almost any other extra logic. fuse-bindings is really low level...

3n-mb commented

Yes. What is type conversion?

  • Simple ones are obvious (or, are they?): String -> string, Number -> int (32 bit, and there are no 64 bits?)
  • But what about structs? attr -> Object? Ok, but can my object have only some fields, while others are missing?
  • And what structs are involved? Is there only attr, or are there other ones? (Excuse my not knowing FUSE at all.)

I'm not the project developer, so I can't be able to answer you that, sorry :-( You'll need to take a look on the code.

3n-mb commented

@piranna I made a PR #66.
Given that you did write fs-use, you may be able to tell me:

  • if Stats object should be exactly like one in fs module, or slightly different.
  • if operators like read with both path: string and file descriptor fd: number should actually be with fd: number|undefined, i.e. doing identification via either path or descriptor.
  • if open must return a file descriptor, and how it plays with either path or descriptor uses.
3n-mb commented

Looking at getattr in example, there is no difference in returned stats. How does other side know that it has a file or directory?

@3n-mb According to man 7 inode, it looks like the mode is a combination of file type and permissions.

// dr--r--r--
mode = fs.constants.S_IFDIR | fs.constants.S_IRUSR | fs.constants.S_IRGRP | fs.constants.S_IROTH

// -rw-------
mode = fs.constants.S_IFREG | fs.constants.S_IRUSR | fs.constants.S_IWUSR

it looks like the mode is a combination of file type and permissions

You are correct about that.