« Return to Thread: Edit : cannot save on sshfs mounted file system

Re: Edit : cannot save on sshfs mounted file system

by Samuel Dionne-Riel :: Rate this Message:

Reply to Author | View in Thread

Le Fri, 09 May 2008 20:25:00 +0100, Thomas Leonard a écrit :

> 2008/5/7 Lennon Cook <lennon@...>:
>
> That still leaves you with an inconsistent file during the save (which
> can be a problem for config files) and if the save fails.
>
> Any idea why the rename is failing?
>
> Also, it shouldn't be losing the permissions (it preserves them for me,
> on a normal filesystem).

I have no idea of why the rename is failing, it must be a problem with
sshfs, here's what I tried in the console:
samuel@HOMER:~/BENCH/test/silence$ nano test.txt
samuel@HOMER:~/BENCH/test/silence$ touch bla.txt
samuel@HOMER:~/BENCH/test/silence$ mv bla.txt test.txt
mv: ne peut déplacer `bla.txt' vers `test.txt': Opération non permise
[can't move bla.txt to test.txt]
samuel@HOMER:~/BENCH/test/silence$ cd ..
samuel@HOMER:~/BENCH/test$ cd ..
samuel@HOMER:~/BENCH$ touch test.txt
samuel@HOMER:~/BENCH$ nano test
samuel@HOMER:~/BENCH$ nano test.txt
samuel@HOMER:~/BENCH$ touch bla.txt
samuel@HOMER:~/BENCH$ nano test.txt
samuel@HOMER:~/BENCH$ mv bla.txt test.txt
samuel@HOMER:~/BENCH$

silence is in a sshfs mountpoint, BENCH is in my home mountpoint.

--

Anyway, here's a wonky-really-crazy "patch" I made, don't tell me I'm mad
for doing this, I already know.

Replace line 164 of current version of ROX-Lib2/python/rox/saving.py
                                os.rename(tmp, path)
by
                                tmp2 = 'tmp2-' + `random.randrange
(1000000)`
                                tmp2 = os.path.join(parent_dir, tmp2)
                                os.rename(path, tmp2)
                                os.rename(tmp, path)
                                os.unlink(tmp2)

I know it seems crazy, but it's a proof of concept that at least makes
Edit useable, but I'm sure that any python gurus will scream at me when
seeing this, this must be a really ugly hack...

Now, I'm off searching the sshfs mailing list or at least contact
someone, as it may seem that the problem isn't on your end...


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
rox-users mailing list
rox-users@...
https://lists.sourceforge.net/lists/listinfo/rox-users

 « Return to Thread: Edit : cannot save on sshfs mounted file system