Merge pull request #519 from NilsBossung/std.path_deprecations

std.path deprecations
This commit is contained in:
Kato Shoichi 2012-04-14 02:11:57 -07:00
commit 022808fa68
3 changed files with 9 additions and 9 deletions

View file

@ -29286,7 +29286,7 @@ assert(tz.dstName == "PDT");
version(Posix)
auto file = tzDatabaseDir ~ name;
else version(Windows)
auto file = tzDatabaseDir ~ replace(strip(name), "/", sep);
auto file = tzDatabaseDir ~ replace(strip(name), "/", dirSeparator);
enforce(file.exists, new DateTimeException(format("File %s does not exist.", file)));
enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
@ -29595,10 +29595,10 @@ assert(tz.dstName == "PDT");
version(Posix)
subName = strip(subName);
else version(Windows)
subName = replace(strip(subName), "/", sep);
subName = replace(strip(subName), "/", dirSeparator);
if(!tzDatabaseDir.endsWith(sep))
tzDatabaseDir ~= sep;
if(!tzDatabaseDir.endsWith(dirSeparator))
tzDatabaseDir ~= dirSeparator;
enforce(tzDatabaseDir.exists, new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));

View file

@ -539,8 +539,8 @@ ulong getSize(in char[] name)
const (char)[] file = name[];
//FindFirstFileX can't handle file names which end in a backslash.
if(file.endsWith(sep))
file.popBackN(sep.length);
if(file.endsWith(dirSeparator))
file.popBackN(dirSeparator.length);
WIN32_FIND_DATAW filefindbuf;
@ -1965,8 +1965,8 @@ else version(Windows)
_name = path.idup;
//FindFirstFileX can't handle file names which end in a backslash.
if(_name.endsWith(sep))
_name.popBackN(sep.length);
if(_name.endsWith(dirSeparator))
_name.popBackN(dirSeparator.length);
WIN32_FIND_DATAW fd;

View file

@ -59,6 +59,7 @@ version(Posix)
import core.stdc.errno;
import core.sys.posix.pwd;
import core.sys.posix.stdlib;
private import core.exception : onOutOfMemoryError;
}
@ -2795,7 +2796,6 @@ deprecated:
version(Posix)
{
private import core.sys.posix.pwd;
private import core.exception : onOutOfMemoryError;
}
version(Windows)