[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[solved] Re: sshfs and sed -i



On 2008-09-08 17:27, Johannes Wiedersich wrote:
> On lenny, I have mounted a remote directory via sshfs:
> $ sshfs user@remote:/path/to/dir dir
> 
> $ sed -i s/foo/bar/ testfilec
> sed: cannot rename ./sedz1MMtd: Operation not permitted

This seems to be related to this point in

/----/usr/share/doc/sshfs/FAQ.txt.gz---
Why does SVN (etc...) fail to rename files?

$ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
svn: Can't move 'kdelibs/.svn/tmp/entries' to 'kdelibs/.svn/entries':
Operation
 not permitted

   The reason is that SFTP protocol version 3 (which is implemented by
   OpenSSH's sftp-server) defines the rename operation slightly
   differently than POSIX. The difference is that renaming to an existing
   file or directory will fail instead of atomically replacing the old
   file.

   The -o workaround=rename option will try to emulate POSIX rename
   semantics, but it cannot guarantee atomicity. In most of the cases
   this doesn't matter, and things will work fine with this option.
\----

The '-o workaround=rename' option to sshfs solves it for me.

It's a shame that OpenSSH isn't posix compatible.

Hope this will help someone with the same problem.

Cheers,

Johannes

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: