os.link & NTFS 5

Christian Tismer tismer at tismer.com
Sun Dec 29 12:37:54 EST 2002


Irmen de Jong wrote:
> Martin v. Löwis wrote:
> 
>> Alas, a single binary needs to support all Windows versions, that's 
>> why CreateHardLink cannot be used.
> 
> 
> If I'm not mistaken, (hard)links in the filesystem level are only supported
> on NTFS 5 (windows 2000/xp). Even Windows NT 4 doesn't support them, let
> alone the non-NT windows versions.
> 
> So, why could the single binary not check the OS version and either call
> the CreateHardLink system call if it's supported, and throw an error when
> it isn't?

Well, I would add it to the win32 extensions, or write
another extensions with special versions for certain
functions like hard links. The os module could try
to import such a module and decide to support the
function or to declare it absent.
The function would simply disappear for son-supported
Windows versions, the same way as the function is
missing completely right now.

I don't think it is too hard to write such an extension,
with MHammonds Win32 extensions as a template.
It was just never urgent for to have hard links, and
basically I find them confusing on Unix. This was
probably also part of the reasons why softlinks are
the preferred way today. So, really working soft links
for Windows would be what I like.

But if anybody can explain to me why it is urgent to
have hard links under Windows, I might write such a
module. This could be easily implanted via site.py
and would not mean a change to the Python core.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/






More information about the Python-list mailing list