Created attachment 21829 [details] new function: apr_file_link() I propose adding a new function to APR file_io module: apr_file_link(). This function creates a hard link from one file to another file and is a core POSIX system call. The attached patch includes a Unix and Win32 implementation, along with a unit test named 'testfilelink'. See the POSIX documentation for link(2) for more information about the system call. Windows implements this for NTFS filesystems using the CreateHardLink() function. Thank you, and my ASF contributor agreement was sent to the Foundation via US Postal service yesterday. Regards, - Mark Heily
Created attachment 21830 [details] new function: apr_file_link() The previous patch was missing a change to Makefile.in, so I simplified it and merged the unit test into the 'testfilecopy' test. Now there are no changes to the build system :)
Committed to the trunk. Thanks for the patch! We have a commit then review policy, so people on the list may have comments. Stay tuned.
Windows CreateHardLink() takes 3 args, per: http://msdn.microsoft.com/en-us/library/aa363860(VS.85).aspx Since all platforms use unix/copy.c - moved apr_file_link to open.c for unix to keep it in the same place on all platforms. Work fine on Windows now. Nice addition to apr Mark!