[erlang-patches] patch to enable both hard and symbolic linking on win32
Björn Gustavsson
bgustavsson@REDACTED
Tue Oct 5 14:53:00 CEST 2010
On Tue, Oct 5, 2010 at 12:39 AM, Blaine Whittle <BWhittle@REDACTED> wrote:
> This patch adds support for both hard and symbolic linking for Windows.
>
> This patch is a resubmission via a patch originally submitted on 9/2/2009 by Alex Tearse-Doyle.
>
> Hard linking requires XP or later and a NTFS formatted drive.
>
> Symbolic linking on Windows requires either Windows Vista, Windows Server 2008, or Windows 7. The Windows API call for creating symbolic links is dynamically executed via LoadLibrary, which allows a single binary to handle both the OS supported and OS not-supported cases. For example calling file:make_symlink on a Windows XP will return {error, enotsup}, however the same call should work as expected on Windows Vista.
>
> All the file module functions are supported: make_link/2, make_sym_link/2, read_link/1 and read_link_info/1. Code has been added so that read_info/1 could return the number of hard links on the file. However, this code has been commented out as it severally affects the performance of read_info/1 on windows. We left the code in the patch to allow anyone to enable this feature if needed.
>
> On a side note, the file.erl man page, {error, exdev} isn't listed on file's man page as a valid return type for make_link, however the error is (correctly) returned when attempting to create a hard link to file on another volume (which should result in {error, exdev}).
>
> Patch is located at git fetch git://github.com/bwhittle/otp.git win32_file_linking
>
>
Please read
http://github.com/erlang/otp/wiki/Writing-good-commit-messages
and fix your commit message (especially the first line and the overlong lines).
Also, the coding style (especially the placement of opening braces) is
different from the rest of the file. The indentation also seems to be off (but
I have only looked at the diff, so I could be wrong).
--
Björn Gustavsson, Erlang/OTP, Ericsson AB
More information about the erlang-patches
mailing list