On Tue, May 31, 2005 at 04:04:58PM +0200, Martin Koeppe wrote: >> On Tue, May 31, 2005 at 01:39:04AM +0200, Martin Koeppe wrote: >> >Hello, >> > >> >I recently found out that you cannot create hardlinks >> >on mounted network shares with cygwin >> >(error: No such file or directory), >> >but you can do it with the ln.exe from Interix. >> > >> >So I looked at it and found that the Windows API >> >function CreateHardLink() causes the trouble, it apparently >> >only works for local drives. >> > >> >There is another API function, however, which creates hardlinks >> >correctly on local and network drives (tested on Win2003 shares >> >and Samba shares): >> > >> >MoveFileEx() with parameter: >> >#define MOVEFILE_CREATE_HARDLINK 16 >> >> I've found two references to this in MSDN. Both say: >> >> MOVEFILE_CREATE_HARDLINK Reserved for future use. >> >> That doesn't sound too encouraging as far as compatibility is concerned. > >Ok, but what do you think is better: >Failing with inappropiate error: "no such file or directory" >or using a not fully documented API function, but getting the >link right? >If you do (with the current cygwin version) on a network drive: > >$ ln -s source symdest > >works ok, but > >$ ln source harddest >ln: creating hard link `harddest' to `source': No such file or directory > >One could consider this as incompatibility, too, >because the source file is definitely there. >It would be somewhat better, if it noted, that cygwin doesn't >support creating hardlinks on network shares, and then copy the file. > >But for me, even copying would be bad, as I need the link semantic >in my case. So copying may be considered incompatible as well. > >I did another test: I used MoveFileExA() on Win98 on a >Win2000 mounted share. But there, instead of a hardlink, an >ordinary move is done, i.e. source gets deleted.
This is what I mean about compatibility. If you want to discuss this further, please use the cygwin list. This list is for actual patches, not enhancement requests. cgf
