This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

link() is copying on NTFS


On NT4.0sp3 on NTFS filesystem running b18

I MUST be missing some fundamental configuration option but...

It appears as if the link() system call is actually copying the file!
While one has to do that on FAT - NTFS does support multiple names for a
file. This trivial program:

#include <sys/types.h>
#include <sys/stat.h>
main(ac, av)
int	ac;
char	**av;
{
    struct stat	sb;

    if (link(av[1], av[2]) == 0
    && stat(av[2], &sb) == 0) {
	printf("Links = %d\n", sb.st_nlink);
	return 0;
    }
    return 1;
}

prints 1 on gnu-win32 and 2 on UNIX (provided the target does not exist! etc
etc) The new file on gnu-win32 is really different....
The "ln" command is consequently broken as well.

Thanks, Eric Mills.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]