http://d.puremagic.com/issues/show_bug.cgi?id=3848



--- Comment #3 from Jonathan M Davis <jmdavisp...@gmail.com> 2010-02-24 
23:31:35 PST ---
Actually, after playing around with this a bit more, I think that I'm leaning
towards it being more useful for isdir() and isfile() to use stat. It can
result in less efficient code, but it's a lot easier to deal with the symlinks
that way. If isdir() and isfile() use lstat, you have to call getAttributes()
on the symlink to find out what it is, and that means anding the return value
with the appropriate flags, and that's not terribly user-friendly.

In fact, it would actually be nice if getAttributes() returned an enum or
struct rather a uint. I believe that it's quite OS-dependent as it is, and you
have to look at file.d to have any clue what the return value represents.
Ideally, you wouldn't have to look a function's source code to figure out how
to deal with its return value. But the whole issue of getAttributes() is more
or less a separate (albeit connected) issue.

In any case, I think that from a user-friendliness perspective, you're right in
your assessment that it would be better to have isdir() and isfile() use stat
rather than lstat. It does, however, mean that you have to be that much more
careful with isdir() or we risk recursive issues or removing stuff in the
directory that it points to rather than just the link in functions like
rmdirRecursive().

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to