Thread overview
[phobos] Feature request: new method for std.file.DirEntry
Jan 08, 2013
Peter Williams
Jan 08, 2013
Peter Williams
January 08, 2013
I would like to request the addition of a method named linkStatBuf() to DirEntry (in the std.file module) which would have the same relationship to statBuf() as linkAttributes() has to attributes().

As part of learning D, I'm reimplementing GNU patch in D (lots of messy problems to be solved which accelerates learning) and one of its options allows the user to specify whether soft links should be followed or not and to do this I need access to the soft link's stat struct preferably via a standard D mechanism. The above requested feature would provide such a mechanism.

In the meantime are lstat, stat etc accessible via any of the libraries in phobos or do I have to do it the hard way?

Thanks,
Peter
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos

January 08, 2013
On 08/01/2013 08:02, Peter Williams wrote:
> In the meantime are lstat, stat etc accessible via any of the libraries
> in phobos or do I have to do it the hard way?

Prototypes for the entire POSIX API are provided in druntime, in the core.sys.posix package.  I believe core.sys.posix.sys.stat is the module you are looking for in this case.

Lars
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos

January 09, 2013
On 08/01/13 20:04, Lars Tandle Kyllingstad wrote:
> On 08/01/2013 08:02, Peter Williams wrote:
>> In the meantime are lstat, stat etc accessible via any of the libraries
>> in phobos or do I have to do it the hard way?
>
> Prototypes for the entire POSIX API are provided in druntime, in the
> core.sys.posix package.  I believe core.sys.posix.sys.stat is the module
> you are looking for in this case.
>
> Lars
> _______________________________________________
> phobos mailing list
> phobos@puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos

Thanks. That's exactly what I need.
Peter
PS I couldn't see reference to these in the library documentation which is why I asked.  Seems that there's a fair bit of good stuff hidden away in the libraries which is hard to find.
_______________________________________________
phobos mailing list
phobos@puremagic.com
http://lists.puremagic.com/mailman/listinfo/phobos