0 votes
by (250 points)
edited

Hello!

We have developed some specific FUSE-based file system which we want to present using your SFTP library. The problem is the fact that we can not implement hard links in our file system. I found that Rename method from Sftp class requires hard links and does not work with our file system. In the SFTP library we were using previously there was a different implementation of rename method which was working with our file system without problems.

Is it possible for you to add alternate implementation of rename which does not need hard links?

Applies to: Rebex SFTP

2 Answers

0 votes
by (148k points)
edited

Hello,

Rebex SFTP implementes the client side of SFTP/SSH protocols and Sftp object's Rename method simply sends an SSH_FXP_RENAME command to the server and waits for response, as defined by the SFTP protocol. The SSH_FXP_RENAME command itself has 3 arguments - request ID, oldpath and newpath. This means that Rebex SFTP doesn't utilize or require any hard links. However, those are actually used by many SFTP servers such as OpenSSH that implement SSH_FXP_RENAME as defined by the protocol - see this and this. There is a protocol extension method in OpenSSH 4.8 (and later) called "posix-rename@openssh.com" that performs POSIX atomic rename(). This seems to be exactly what you need. We will look into the possibility of adding support for this (should be rather simple) and let you know!

by (250 points)
edited

It is exactly as you wrote. We need a SFTP library which can call POSIX rename method. If you could implement it, then your library will offer all the functionality which we need. Maybe except the xattr implementation, but we are not sure if we really need it.

by (148k points)
edited

I just sent you a link to the current build with POSIX rename support, please give it a try. This feature will be added to the next release of Rebex SFTP.

+2 votes
by (18.1k points)
edited

Since Version 2012 R2, the Rebex SFTP component supports the POSIX rename ('posix-rename@openssh.com' extension).

Set the new SftpSettings.UsePosixRename property to true to enable this feature in your application.

...