August 28, 2005 std.file.exists is wrong for linux | ||||
---|---|---|---|---|
| ||||
int exists(char[] name) { * return access(toStringz(name),0) != 0; should be * return access(toStringz(name), 0) == 0; 0 is used as the success value for access, according to the man pages. It should also return a bit/bool, not int. Regards, James Dunne |
August 28, 2005 Re: std.file.exists is wrong for linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to James Dunne | "James Dunne" <james.jdunne@gmail.com> wrote in message news:der1dj$2cs4$1@digitaldaemon.com... > int exists(char[] name) > { > * return access(toStringz(name),0) != 0; > > should be > > * return access(toStringz(name), 0) == 0; > > 0 is used as the success value for access, according to the man pages. It should also return a bit/bool, not int. > > Regards, > James Dunne fwiw, the unittests on Linux fail in std.math (line 247), std.file (on the issue you mention) and std.boxer (I can't remember which line). |
Copyright © 1999-2021 by the D Language Foundation