Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100760 > unrolled thread
| Started by | Random832 <random832@fastmail.com> |
|---|---|
| First post | 2015-12-22 23:29 -0500 |
| Last post | 2015-12-24 13:58 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
Why doesn't os.remove work on directories? Random832 <random832@fastmail.com> - 2015-12-22 23:29 -0500
Re: Why doesn't os.remove work on directories? Laurent Delacroix <laurent@krutt.org> - 2015-12-24 13:58 +0100
| From | Random832 <random832@fastmail.com> |
|---|---|
| Date | 2015-12-22 23:29 -0500 |
| Subject | Why doesn't os.remove work on directories? |
| Message-ID | <mailman.77.1450844962.2237.python-list@python.org> |
This is surprising to anyone accustomed to the POSIX C remove function, which can remove either files or directories. Is there any known rationale for this decision?
[toc] | [next] | [standalone]
| From | Laurent Delacroix <laurent@krutt.org> |
|---|---|
| Date | 2015-12-24 13:58 +0100 |
| Message-ID | <n5gq64$ffh$1@speranza.aioe.org> |
| In reply to | #100760 |
On 23/12/15 05:29, Random832 wrote: > > This is surprising to anyone accustomed to the POSIX C remove > function, which can remove either files or directories. Is there > any known rationale for this decision? > Hello, in POSIX C the remove() function is actually rmdir() when called on a directory: http://bit.ly/1NE1rfZ I'm not sure about the rationale behind raising OSError if the argument is a directory though. Maybe the "There should be one-- and preferably only one --obvious way to do it." philosophy explains it. :-) Lau
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web