FW:

View: New views
1 Messages — Rating Filter:   Alert me  

FW:

by Alex Tearse-Doyle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

This patch adds support for both hard and symbolic linking  for Windows.   

 

Hard linking requires XP and an 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. The normal read_info/1 gives the number of links and uses the target of a symbolic link.

 

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}). 

 




________________________________________________________________
erlang-patches mailing list. See http://www.erlang.org/faq.html
erlang-patches (at) erlang.org

win_efile.diff (6K) Download Attachment