Path as an object in std.path
Regan Heath
regan at netmail.co.nz
Thu Jun 6 04:19:44 PDT 2013
On Thu, 06 Jun 2013 11:43:51 +0100, Lars T. Kyllingstad
<public at kyllingen.net> wrote:
> On Thursday, 6 June 2013 at 10:30:05 UTC, Regan Heath wrote:
>> On Thu, 06 Jun 2013 08:05:51 +0100, Lars T. Kyllingstad
>> <public at kyllingen.net> wrote:
>>> Paths are usually obtained in string form, and they are normally
>>> passed to other functions and third party libraries in string form.
>>> Having to convert them to something else just to do what is, in fact,
>>> string manipulations, is just annoying.
>>
>> Agree 100%.
>>
>> C# has Path.Combine which builds paths from strings, returning a string
>> and this is good.
>>
>> It also has System.File and System.Directory static classes with static
>> methods taking string, also good.
>>
>> But, C# also has System.IO.FileInfo and System.IO.DirectoryInfo which
>> are constructed from a string, and then have methods which mirror the
>> static methods from System.File plus a refresh method to update the
>> cached file attributes etc obtained from the file system. I find these
>> objects useful.
>>
>> It would be nice for D to have similar objects, IMO.
>
> It does have a similar type: std.file.DirEntry.
> http://dlang.org/phobos/std_file.html#.DirEntry
Ahh.. excellent. In that case, I don't think we want/need the Path being
proposed.
Side-note; DirEntry is a very UNIX centric name - I only know that
because I have coded with it, I wonder what pure windows developers make
of it..
R
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
More information about the Digitalmars-d
mailing list