www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12391] New: DirEntries throws in foreach

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12391

           Summary: DirEntries throws in foreach
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: jason spashett.com


--- Comment #0 from Jason Spashett <jason spashett.com> 2014-03-17 07:52:24 PDT
---
Using DMD Version 2.065, Windows 7 x86

A previous similar issue has been fixed on Linux.
http://d.puremagic.com/issues/show_bug.cgi?id=8298


To reproduce this try iterating over c:\windows it will yield an access denied
exception. Alternatively create some directory in a sub directory and remove
your access to it.

The error I got was: std.file.FileException std\file.d(2519):
c:/windows\CSC\v2.0.6: Access is denied

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 17 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12391



--- Comment #1 from Jason Spashett <jason spashett.com> 2014-03-17 07:55:30 PDT
---
example code:
    import std.file;
    foreach (DirEntry e; dirEntries("c:/windows", SpanMode.depth))
    {
        writeln("entry: ", e.name);
    }

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 17 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12391


Mike Wey <mike-wey planet.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike-wey planet.nl
         OS/Version|Windows                     |Linux


--- Comment #2 from Mike Wey <mike-wey planet.nl> 2014-03-18 15:42:18 PDT ---
dirIterator throws an exception when it tries to traverse into a directory for
which it does not have any read permissions.

This issue also exists on Linux/posix systems.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 18 2014