Bug 8298 – dirEntries special linux file in Home dir
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-25T11:17:00Z
Last change time
2015-06-09T05:15:17Z
Keywords
pull
Assigned to
nobody
Creator
bioinfornatics
Comments
Comment #0 by bioinfornatics — 2012-06-25T11:17:25Z
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 );
}
Comment #1 by dlang-bugzilla — 2012-12-21T21:25:22Z
How to create such a special file, in order to reproduce the problem?
Comment #2 by mike — 2013-02-16T08:13:38Z
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.
Comment #3 by mike — 2013-11-13T13:15:52Z
*** Issue 11501 has been marked as a duplicate of this issue. ***
Comment #4 by timothee.cour2 — 2014-01-07T15:41:11Z
Is anything blocking the pull ?
Comment #5 by github-bugzilla — 2014-01-07T16:23:53Z