Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 18:30:53 UTC, Adam D. Ruppe wrote: On Saturday, 10 December 2016 at 18:09:43 UTC, unDEFER wrote: I know, but why it works in Linux by Linux documentation? Coincidence. That detail is undefined in the D documentation which means the implementation is free to do

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 December 2016 at 18:09:43 UTC, unDEFER wrote: I know, but why it works in Linux by Linux documentation? Coincidence. That detail is undefined in the D documentation which means the implementation is free to do whatever is easier for it in a platform-specific manner.

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 14:10:15 UTC, ag0aep6g wrote: On 12/10/2016 04:39 AM, unDEFER wrote: man remove: remove - remove a file or directory That's documentation for C, not for D. I know, but why it works in Linux by Linux documentation?

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread ag0aep6g via Digitalmars-d-learn
On 12/10/2016 04:39 AM, unDEFER wrote: man remove: remove - remove a file or directory That's documentation for C, not for D. The function which removes only files named unlink. The D must guarantee the same behaviour of remove on all OSes. D has no obligation to follow C in function nami

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 03:36:11 UTC, Adam D. Ruppe wrote: On Saturday, 10 December 2016 at 03:29:18 UTC, unDEFER wrote: But it works under Linux That's just because the underlying C function handles the case. But the D function makes no promises about that: std.file.remove's docume

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 01:30:52 UTC, Jonathan M Davis wrote: On Saturday, December 10, 2016 01:19:45 unDEFER via Digitalmars-d-learn wrote: Well, much as I'd love to rag on Windows for doing dumb and annoying stuff with file locks (which they do do), in this case, your code wouldn't

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 December 2016 at 03:29:18 UTC, unDEFER wrote: But it works under Linux That's just because the underlying C function handles the case. But the D function makes no promises about that: std.file.remove's documentation says "removes the file", leaving what it does to directories

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 01:28:13 UTC, SonicFreak94 wrote: On Saturday, 10 December 2016 at 01:19:45 UTC, unDEFER wrote: remove("D:\\TEST"); Try rmdir instead. But it works under Linux

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, December 10, 2016 01:19:45 unDEFER via Digitalmars-d-learn wrote: > Hello! > > $ cat try.d > import std.file; > > void main () > { > mkdir("D:\\TEST"); > remove("D:\\TEST"); > } > > $ ./try.exe > > std.file.FileException@std\file.d(731): D:\TEST: Access Denied. > ---

Re: mkdir; remove; under Windows throw Exception

2016-12-09 Thread SonicFreak94 via Digitalmars-d-learn
On Saturday, 10 December 2016 at 01:19:45 UTC, unDEFER wrote: remove("D:\\TEST"); Try rmdir instead.