www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8298] New: dirEntries special linux file in Home di

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

           Summary: dirEntries special linux file in Home di
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bioinfornatics gmail.com



11:17:25 PDT ---
when i use std.file.dirEntries it fail when scanning the home directory(linux)
because thay are some special files e.g:
Failed to stat file `./.pulse/b86d160eca2ebd0f61847c4600000013-runtime'

it will be good to have a way to list both files an dir in any case ...



import std.file;
import std.algorithm;
import std.stdio;
import std.path;
import std.array;

void main(){
    DirEntry[] dFiles = array( dirEntries( ".", SpanMode.depth ).filter!( ( a )
=>  a.name.extension == ".d"  ) );
    foreach( d; dFiles )
        writeln( d );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 25 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8298


Vladimir Panteleev <thecybershadow gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow gmail.com



21:25:22 PST ---
How to create such a special file, in order to reproduce the problem?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 21 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8298


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike-wey planet.nl



The special file as an broken symlink. The Exception is thrown because stat
return an error code in that case.

With this pull request:
https://github.com/D-Programming-Language/phobos/pull/1142

I've changed ensureStatDone so it also tries lstat if stat fails as to support
broken symlinks in DirEntry.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 16 2013