What is the rationale behind std.file.setAttributes ?

Jonathan M Davis jmdavisProg at gmx.com
Fri Dec 27 22:12:37 PST 2013


On Saturday, December 28, 2013 06:54:53 Marco Leise wrote:
> For Phobos we need portable solutions. But it is also clear that
> std.file.setAttributes cannot be replaced to 100% by a portable
> solution. The question is: Does portable code _care_ about setting
> each possible chmod flag or Windows file attribute? Or are the use
> cases much more limited there, like making a file read-only or
> querying if it is a directory?

We need to try hard to make Phobos cross-platform and portable, but some stuff 
just can't be, and std.file already has some functions which fall in that 
category (e.g. anything symlink related or dealing with file times). And having 
a D wrapper around that functionality can make code much cleaner, so I'm all 
for having a limited number of system-specific functions in std.file if that's 
what it takes to get the job done (and file permissions tend to fall in that 
category).

- Jonathan M Davis


More information about the Digitalmars-d mailing list