Giter Site home page Giter Site logo

fusepy's People

Contributors

billziss-gh avatar eestrada avatar ihaveamac avatar johannesbuchner avatar lpzummer avatar nickcoutsos avatar nmtadam avatar rianhunter avatar rncry avatar steinbeck65 avatar terencehonles avatar

Stargazers

 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

fusepy's Issues

damaged file contents when using the loopback example

First off, thanks for your great work on making FUSE available on windows - in deed with minimal changes to existing code relying on fusepy!

But unfortunately, I couldn't get the loopback.py example to run without issues on windows.
The following functions of the os module, that are used in the official loopback example, are not available on windows: chown, fdatasync, mknod, statvfs
Commenting out their usage in the example (see here) will make it run without an ImportError, but a comment on how to implement the now missing functionality - or even an updated loopback example using the correct functions when running on windows - would be highly appreciated!
Additionally, one should mention that all path names sent to the driver will be upper-case, probably due to Window's case-insesitivity regarding file names.

With the "fixed" loopback example, reading a bigger file now returns some of its contents damaged (as far as I can see they are replaced by nulls).
I saved some reference data as test.txt in the root folder and tried viewing or copying the file through the mounted loopback folder.
You can find the data in the attached loopback.zip as reference-data.txt, containing the numbers 0 to 1521558 in ASCII code, each on a separate line (so that they are be lined up with their respective line number).

In my first test, I opened the file in the loopback mount using notepad++ and copy-pasted the data to a file outside of the mount. The resulting data and the output of the python code can be found in test1-data.txt and test1-log.txt, respectively. When you scroll to the very end, you can cleary see that the lines are no longer lined up with their line-numbers and some lines are empty or contain only part of the number.

In the second test, I directly copyied the file from inside the mount to an outside folder using Windows Explorer. Now, the line numbers in test2-data.txt seem to match, but there are a lot of null-bytes preceding the number in the last line.

I had similar problems when developing the fusepy driver on Linux, usually they were related to race conditions between the seek and read. As the lookback example protects it's read method using a Lock and the problem persists when calling the FUSE driver with nothreads=True, this is probably not a fault of the python script in this case.

I also found the following possibly related lines occuring multiple times in sequence in the log files:

DEBUG:fuse.log-mixin:-> open C:\Users\niko\Documents\root/TEST.TXT (0,)
DEBUG:fuse.log-mixin:<- open 4
DEBUG:fuse.log-mixin:-> flush C:\Users\niko\Documents\root/TEST.TXT (4,)
DEBUG:fuse.log-mixin:-> getattr C:\Users\niko\Documents\root/TEST.TXT (None,)
DEBUG:fuse.log-mixin:<- flush '[Errno 9] Bad file descriptor'
DEBUG:fuse.log-mixin:-> release C:\Users\niko\Documents\root/TEST.TXT (4,)
DEBUG:fuse.log-mixin:<- getattr {'st_atime': 1520157090.806919, 'st_ctime': 1520157090.806919, 'st_gid': 0, 'st_mode': 33206, 'st_mtime': 1520157117.6736915, 'st_nlink': 1, 'st_size': 12582921, 'st_uid': 0}
DEBUG:fuse.log-mixin:<- release None

So, this issue actually contains 3 smaller and possibly related issues:

  • the loopback example currently doesn't work on windows, as it uses POSIX-only functions from os. A fixed loopback.py example with replacements and some comments with details on the WinFsp FUSE API (e.g. how the replacements work, and that all paths are upper-case) would be nice.
  • when reading file data through the loopback mount, some of it gets corrupted and replaced by null-bytes.
  • those strange open-read-release cycles, that happen multiple times in sequence

Question on Fusepy memory example

I tried the memory example together with winfsp 1.017 on win10. I cannot get it to work.

For example, i cannot copy anything in (not enough space?) When i create a new text document, it can neither be renamed nor accessed.

I'm not sure how Windows determines whether there is enough space for a file. I noticed it runs a statfs call, but adding a few zeroes to the default dict(f_bsize=512, f_blocks=4096, f_bavail=2048) doesn't change anything.

However, i have determined that when Windows is attempting to access a file, it calls getattr with the filename in all caps. Can i check if this is something the person implementing the FUSE is supposed to deal with?

Thanks in advance.

fusell vs. fuse

What is the difference between fusell.py and fuse.py?

The README states:

It's just one file and is implemented using ctypes.

so it's not 100% clear which of these files should be used.

Also, does your fork use Cygwin or does it require the install of WinFSP, or is it 100% independent?

Thanks!

Case sensitive filenames

Hello,

I would like to use Fusepy but I have a problem with filenames.
My backend is working with case sensitive filenames, but Fusepy seems to convert filenames to upper case.

Here are some extracts from my debug log:

$ touch mountpoint/testfile:
[2018-01-11 16:39:44.423462] (Dummy-1) DEBUG: Send: b'{"cmd": "file_create", "path": "/testfile"}\n' [2018-01-11 16:39:44.437530] (Dummy-1) DEBUG: Received: b'{"status": "ok"}\n'

$ ls mountpoint/testfile:
python3.6m[TID=0b3c]: FFFFC384E5CA3300: >>Create [UT---C] "\TESTFILE", FILE_OPEN, CreateOptions=200000, FileAttributes=0, Security=NULL, AllocationSize=0:0, AccessToken=0000000000000520[PID=1b34], DesiredAccess=20080, GrantedAccess=0, ShareAccess=7 [2018-01-11 16:43:15.820282] (Dummy-1) DEBUG: Send: b'{"cmd": "stat", "path": "/TESTFILE"}\n' [2018-01-11 16:43:15.827030] (Dummy-1) DEBUG: Received: b'{"label": "Folder or file not found.", "status": "error"}\n' python3.6m[TID=0b3c]: FFFFC384E5CA3300: <<Create IoStatus=c0000034[0]

Fusepy doesn't try to use /testfile and try only with /TESTFILE (+EXE and LNK extensions).
Is it possible to use case sensitive filenames?

I have found this related issue: winfsp/winfsp#26

can't pass st_file_attributes back

As seen in winfsp/winfsp#114 it seems support for windows file attributes should be present.
The question is how to implement them in a proper way in fuse.py,or what changes are needed to make there.
Unfortunatly setting st_mode to S_IFREG | 0o555 for example is not enough. This would cause the file is readonly but lot of software seems to rely on the windows attributes to work proper.
Any hint how to modify fuse.py would be great.

raw_fi behavior inconsistent for flush

Occasionally, when using raw_fi, we will get an integer instead of a fuse_file_info structure. While the workaround is easy, I suspect, looking at fusepy, that this is a problem in a lower level... where the "contents" of the ffp contains an integer instead somehow. Not really causing an issue (we just do if type(ffi) is int), but might help debugging other stuff.

Issue setting VolumePrefix

When I set the VolumePrefix=/my/share option via a drive-letter fuse mount, the drive mounts correctly, but it shows up as a "Disconnected Network Drive". All of the operations (read/write/stat) seem to work OK.

I also looked through the WinFSP code ... in an attempt to understand if there are other settings needed... but the only one I see is that a non-null VolumePrefix will cause FILE_DEVICE_NETWORK_FILE_SYSTEM to be used and to register with the Mup.

Not sure how Windows gets the status as "disconnected" on these drives... if anyone has any insight, let me know.

EDIT: I think the issue is that when you start a pyfuse mount with a volume prefix, WinFSP doesn't know it's mounted... because it wasn't started using the launcher interface. I'm pretty sure I'd need make a new fuse option to convey this to WinFSP at start.

The primary reason we want it to show up as a "network drive" is that some or all of the the exposed files can be located remotely and we want windows to be nice about not generating thumbs, etc.

Step-by-step how to use it on Windows?

I have Windows 7 64 bit. I currently:

  • don't have Cygwin installed
  • don't have FUSE installed (is there an official version for Win?)
  • WinFSP is installed (is it required to make your fork of fusepy work, or can it work without it?)

I tried your SFTP example (I have paramiko working, I use it successfully in other projects) with mountpoint='Z:\\'
but I get this error:

line 573, in __init__
    raise RuntimeError(err)
RuntimeError: 1

or this error with mountpoint='Z:':

fuse.py", line 478, in set_st_attrs
    setattr(st, key, val)
TypeError: an integer is required (got type NoneType)
The service python has failed to start (Status=c0000005).

How to make it work with Windows?

Using fusepy get error on windows10

Hey, why should i always get this error on windows?
Traceback (most recent call last):
File "build\bdist.win-amd64\egg\fuse.py", line 554, in _wrapper
return func(*args, **kwargs) or 0
File "build\bdist.win-amd64\egg\fuse.py", line 668, in statfs
for key, val in attrs.items():
AttributeError: 'NoneType' object has no attribute 'items'

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.