Path as an object in std.path

Regan Heath regan at netmail.co.nz
Thu Jun 6 03:30:04 PDT 2013


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.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list