Re: errors with filesystem operations

2014-01-20 Thread Hugo Florentino
Update: the combination of both your suggestions worked: if (exists(BlankDirToDelete)) { try rmdir(`\\?\` ~ BlankDirToDelete); catch (FileException e) writeln(e.msg); } Thanks! Now I just have to find out why the block of the file extensions is failing.

Re: errors with filesystem operations

2014-01-20 Thread Hugo Florentino
On Sat, 18 Jan 2014 11:51:48 +, Kagamin wrote: remove uses DeleteFile, but MSDN says To remove an empty directory, use the RemoveDirectory function. so remove probably won't work on directories. You are correct, so I made a few test using rmdir() with a blank for directory name and now I

Re: errors with filesystem operations

2014-01-20 Thread Hugo Florentino
On Sat, 18 Jan 2014 11:33:16 +, Kagamin wrote: On Friday, 17 January 2014 at 12:52:09 UTC, Hugo Florentino wrote: On Fri, 17 Jan 2014 07:07:35 +, Kagamin wrote: Does it fail for that one directory only or for any directory? Interesting question. I would have to do more tests with odd

Re: errors with filesystem operations

2014-01-19 Thread Kagamin
remove uses DeleteFile, but MSDN says To remove an empty directory, use the RemoveDirectory function. so remove probably won't work on directories.

Re: errors with filesystem operations

2014-01-19 Thread Kagamin
On Friday, 17 January 2014 at 12:52:09 UTC, Hugo Florentino wrote: On Fri, 17 Jan 2014 07:07:35 +, Kagamin wrote: Does it fail for that one directory only or for any directory? Interesting question. I would have to do more tests with odd names, but apparently both remove() and rename() ha

Re: errors with filesystem operations

2014-01-17 Thread Hugo Florentino
On Fri, 17 Jan 2014 13:10:00 +, Kagamin wrote: I only noticed that rename uses MOVEFILE_REPLACE_EXISTING flag, which can't be used with directories. Are you sure remove fails too? If rename throws, remove is not called in your code. Well, as a matter of fact I did try to use remove directly

Re: errors with filesystem operations

2014-01-17 Thread Kagamin
I only noticed that rename uses MOVEFILE_REPLACE_EXISTING flag, which can't be used with directories. Are you sure remove fails too? If rename throws, remove is not called in your code.

Re: errors with filesystem operations

2014-01-17 Thread Hugo Florentino
On Fri, 17 Jan 2014 07:07:35 +, Kagamin wrote: Does it fail for that one directory only or for any directory? Interesting question. I would have to do more tests with odd names, but apparently both remove() and rename() have problems with directories with a blank name. Curiously, moving f

Re: errors with filesystem operations

2014-01-16 Thread Kagamin
Does it fail for that one directory only or for any directory?

Re: errors with filesystem operations

2014-01-16 Thread Hugo Florentino
On Thu, 16 Jan 2014 15:41:06 +, Kagamin wrote: Probably because you use ansi api: if filename contains non-english character, there could be a problem. A filesystem support is primarily for storing files, attributes can be safely ignored. Hmm... that may be true for Linux filesystems, but

Re: errors with filesystem operations

2014-01-16 Thread Kagamin
Probably because you use ansi api: if filename contains non-english character, there could be a problem. A filesystem support is primarily for storing files, attributes can be safely ignored.

Re: errors with filesystem operations

2014-01-15 Thread Hugo Florentino
On Wed, 15 Jan 2014 13:41:50 +0100, Jacob Carlborg wrote: ... On Linux, hidden files are all files where the filename starts with a dot. To make it visible you need to rename the file. As far as I know, Linux doesn't have any form of system attribute. I am aware of this. However, FAT32 and NTFS

Re: errors with filesystem operations

2014-01-15 Thread Jacob Carlborg
On 2014-01-15 11:33, Hugo Florentino wrote: Hi, I am trying to make a little application to revert the effect of some viruses on USB memories, and running it from Windows encountered some exceptions that IMHO should not have happened. Maybe I am missing something. Can you please check the commen

errors with filesystem operations

2014-01-15 Thread Hugo Florentino
Hi, I am trying to make a little application to revert the effect of some viruses on USB memories, and running it from Windows encountered some exceptions that IMHO should not have happened. Maybe I am missing something. Can you please check the commented blocks for errors? Also, is there a