billziss-gh / fusepy Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fusepy/fusepy
Simple ctypes bindings for FUSE - Also support Windows
This project forked from fusepy/fusepy
Simple ctypes bindings for FUSE - Also support Windows
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:
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.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.
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!
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
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.
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.
Hello,
It seems fusepy has been mostly unmaintained for a year, is this repository going to be updated more regularly? Do you accept contributions?
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.
I have Windows 7 64 bit. I currently:
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?
Add support for FSP_FUSE_CAP_READDIR_PLUS
when running on Windows or Cygwin under WinFsp-FUSE.
See:
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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.