Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

[VfsFolder] How to not throws an IOException on an "Access Denied"

Moderators: larsivi kris

Posted: 03/22/09 11:58:47 Modified: 03/22/09 14:19:40

Hi all,

I need to list recursively a VfsFolder? (that is an interface of a FileFolder? instance). But in the case that I can't access a folder (for example because of no right to list it), an IOException is throw on the .tree method. So I've got no way to get the tree if there's only one folder with this kind of problem.

Is there a way to get this list,but without files of folders with problems ?

ps: I'm on Windows Vista

Thanks in advance. TSalm

Author Message

Posted: 03/22/09 14:42:02 -- Modified: 03/22/09 14:44:00 by
tsalm

Here is a source to test this :

import tango.io.Stdout; 

import
   tango.io.Stdout
  ,tango.io.vfs.FileFolder
  ,tango.io.vfs.model.Vfs
  ;

void main(char[][] args)
{
 
 char[] path = args[1] ;

 VfsFolder mainFolder = new FileFolder( path ) ; 
 
 VfsFolders lstFolders = mainFolder.tree ;
 
}

If there's a folder with no right to list, an IOException is thrown.

Posted: 03/22/09 21:28:30

not at this time. Will fix soon

Posted: 03/24/09 22:54:57

Thanks Kris.

I'm searching to find a solution to get rigths on a directory. But it's not so simple on Windows, because it seems there's the need to use the helling ACL to get it...