From: TJ S. <cas...@us...> - 2012-12-27 18:30:12
|
Update of /cvsroot/pdd/www.proftpd.org/docs/howto In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10577 Modified Files: FTP.html Log Message: Updated website copy of FTP howto. Index: FTP.html =================================================================== RCS file: /cvsroot/pdd/www.proftpd.org/docs/howto/FTP.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FTP.html 12 Oct 2012 15:23:16 -0000 1.2 +++ FTP.html 27 Dec 2012 18:30:08 -0000 1.3 @@ -337,7 +337,7 @@ <pre> SITE MKDIR /path/to/some/dir/that/is/not/there/ </pre> - Supported by the <code>mod_site_misc</code> module. + Supported by the <a href="../contrib/mod_site_misc.html"><code>mod_site_misc</code></a> module. </li> <p> @@ -350,7 +350,7 @@ <pre> SITE RMDIR /path/to/some/dir/with/files/ </pre> - Supported by the <code>mod_site_misc</code> module. + Supported by the <a href="../contrib/mod_site_misc.html"><code>mod_site_misc</code></a> module. </li> <p> @@ -362,7 +362,7 @@ <pre> SITE SYMLINK src dest </pre> - Supported by the <code>mod_site_misc</code> module. + Supported by the <a href="../contrib/mod_site_misc.html"><code>mod_site_misc</code></a> module. </li> <p> @@ -373,9 +373,8 @@ <pre> SITE UTIME 200412312359 /path/to/some/file.txt </pre> - Supported by the <code>mod_site_misc</code> module. + Supported by the <a href="../contrib/mod_site_misc.html"><code>mod_site_misc</code></a> module. </li> - </ul> <p> @@ -408,6 +407,57 @@ </li> </ul> +<p><a name="FAQ"> +<b>Frequently Asked Questions</b> + +<p><a name="MoveDirectoriesAcrossDevices"> +<font color=red>Question</font>: I can use the <code>RNFR</code> and +<code>RNTO</code> commands to <i>move</i> a file, even across different +disks/mount points. And I can use <code>RNFR</code>/<code>RNTO</code> to move +a directory, <b>but</b> I <b>cannot</b> move a directory across different +disks/mount points. Is this a bug?<br> +<font color=blue>Answer</font>: No, it is not a bug. Why not? Ultimately, +it is because the FTP specifications do not guarantee (or even <i>discuss</i>) +that an FTP implementation must support renaming of directories across +mount points. +<p> + +<p> +ProFTPD implements the <code>RNFR</code>/<code>RNTO</code> functionality +by using the <code>rename(2)</code> system call. And <code>rename(2)</code> +is documented to <b>not</b> work across mount points. + +<p> +"But then why does it work when I rename a file across mount points?" you +ask. Good question. The answer is that for <b>files only</b>, ProFTPD +detects the <code>rename(2)</code> error for renaming across mount points, +and then <i>copies</i> the file in question to the new location, deleting +the old location when the copy completes successfully. + +<p> +"Great!" you say, "Now do the same thing for directories!" Unfortunately, for +directories, the answer is not that simple. Here are some things to consider +when copying directories: what if the directory contains sockets, FIFOs, +devices, and other irregular file types which cannot be easily copied/moved? +Should copying/moving of directories automatically use root privileges in +order to preserve the ownership on files that do not belong to the logged-in +user? What if the copying/deleting of files fails in the midde: what should +then happen to the copied (and remaining) files/directories? + +<p> +Since there are no easy answers as yet to the above questions, ProFTPD now +detects the <code>rename(2)</code> error for renaming across mount points +for a <b>directory</b>, and rejects the <code>RNTO</code> command, showing +something like: +<pre> + RNFR directory + 350 File or directory exists, ready for destination name + RNTO /other/mount/directory + 550 Rename /other/mount/directory: Is a directory +</pre> +That "Is a directory" error indicates that ProFTPD cannot rename a directory +across the mount points you requested. (That particular error message can, +and will, be made more informative.) <p> <hr> |