os.link & NTFS 5

Wolfgang Strobl wks000 at t-online.de
Thu Dec 26 19:21:13 EST 2002


martin at v.loewis.de (Martin v. Löwis):

>"DP" <pennedinil at excite.com> writes:
>
>> I'm looking for the equivalent of os.link and os.symlink for Python/WinXP
>> (i.e., NTFS 5). These functions seem to be available only on Python/UNIX.
>> They're also available on Python/Cygwin.I haven't found anything similar to
>> this for Win32 platforms.
>
>Correct, this is no equivalent. You could almost say there is no
>equivalent on Win32, any programming language, period. I know this is
>not a precise description of the current state, but quite close to it.


#define _WIN32_WINNT 0x0500
#include <windows.h>
int main(char*argc,char**argv)
{
	CreateHardLink(argv[1],argv[2],NULL);
}

works quite well for creating hard links on w2k and XP.

For an equivalent to symlinks, I'd try NTFS Junction Points 

-- 
Thank you for observing all safety precautions



More information about the Python-list mailing list