Rename file without overwriting existing files

Jon Ribbens jon+usenet at unequivocal.eu
Mon Jan 30 10:40:05 EST 2017


On 2017-01-30, Peter Otten <__peter__ at web.de> wrote:
> Jon Ribbens wrote:
>> On 2017-01-30, Peter Otten <__peter__ at web.de> wrote:
>>> However, the current Python version of link() is sufficiently different
>>> from
>>><https://linux.die.net/man/2/link>, say, to warrant its own documentation.
>> 
>> What are you referring to here? As far as I can see, the current
>> Python implementation of link() just calls the underlying OS call
>> directly.
>
> The current signature differs from that of link()
>
> os.link(src, dst, *, src_dir_fd=None, dst_dir_fd=None, follow_symlinks=True)
>
> but it looks like you are right in so far as link() is still called by 
> default:

Yeah, it's been extended to call linkat() if the extra parameters are
provided, but it still calls link() if you call it like link().

So basically it's been extended analogously to how Linux has been,
and the OS manpage is still the right place to look to understand
what it does. (linkat() is documented as part of the same manpage as
link() anyway.)


More information about the Python-list mailing list