[Python-ideas] Have os.unlink remove directories on Unix (was: junction points on Windows)

random832 at fastmail.us random832 at fastmail.us
Mon Aug 26 06:19:52 CEST 2013


On Sun, Aug 25, 2013, at 14:26, Kim Gräsman wrote:
> Ping?
> 
> Can I clarify something to move this forward? It seems like a good
> idea to me, but I don't have the history of Py_DeleteFileW -- maybe
> somebody tried this already?

What happens if you call os.rmdir? And just out of curiosity, what
happens if you call msvcrt's _wremove and _wrmdir functions?

While we're on the subject of os.remove, can someone explain to me why
it doesn't work on directories in Unix? That's the main difference
between the C function of that name vs unlink in POSIX, and there
doesn't seem to be a "remove a file or directory" function in os at all
on unix systems as it stands (whereas both of them seem to be able to
remove directories on windows).

I'm almost more bothered by the fact that it works on Windows and not on
Unix (and a bit by the fact that the "remove" name was used without
actually implementing the behavior or calling the POSIX "remove"
function) than by the functionality not existing in the first place. But
it makes much more sense to add the functionality on Unix than to remove
it on windows. Alternately, we could create a distinction between unlink
and remove, and only do this in remove.


More information about the Python-ideas mailing list