Natasha15030003 / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Is it possible to copy a file from outside into the fuse mount without using fscp? #175

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. fsmount mem:// ram
2. Try to copy a file from another folder into the ram folder
cp ~/Documents/samplefile.txt ram

Now the MemoryFS tries to read from the samplefile.txt as if it is in it's own 
filesystem and so it won't work and fail with an error like this:

Error opening file '/path/to/ram/samplefile.txt': No such file or directory

Im using ArchLinux with fuse 2.9.3

If I copy with the fscp utility it actually works:
fscp ram foo

Is there any chance how to properly copy without using the fscp command?

Original issue reported on code.google.com by m...@lukasmartinelli.ch on 29 Mar 2014 at 4:29

GoogleCodeExporter commented 8 years ago
I believe you're probably seeing the same thing as 
https://groups.google.com/forum/#!topic/pyfilesystem-discussion/lXO7mLrgr4E

i.e. when you mount the MemoryFS, it creates a copy and 'detaches' from the 
original FS.

Maybe a TempFS would suit you better?

Original comment by gc...@loowis.durge.org on 30 Mar 2014 at 7:51

GoogleCodeExporter commented 8 years ago
Thanks for your prompt answer. I think you misunderstood me.
I'm not manipulating the filesystem with python, I am using bash or an explorer 
like nautilus to work with the mounted filesystem and I am unable to copy from 
a folder outside the mounted directory into the mounted directory.

I think the problem is the following:
If I make a simple command in bash like:
cp /path/to/file/outside_mountdir/source /mounteddir/target
This will result in opening all the files in source and writing them to the 
target.
Now when opening the file, the fuse implementation tries to open it on the 
assigned filesystem, which of course won't work because the path is outside the 
filesystem.

One could probably check for any open command in the fuse implementation wether 
the path exists in OSFS and if it does use the OSFS and not the assigned fs.

Original comment by m...@lukasmartinelli.ch on 31 Mar 2014 at 9:52

GoogleCodeExporter commented 8 years ago
This should actually work, but I get the same thing on Ubuntu. Possibly a bug 
introduced in 0.5.0 or a change to the fuse binaries.

Original comment by willmcgugan on 31 Mar 2014 at 10:06

GoogleCodeExporter commented 8 years ago
Would this perhaps be resolved by using fusepy 2.0.2 instead of the older 
fusepy embedded in PyFilesystem?

Original comment by m...@lukasmartinelli.ch on 2 May 2014 at 6:51