mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 23:20:29 +03:00
Merge pull request #519 from NilsBossung/std.path_deprecations
std.path deprecations
This commit is contained in:
commit
022808fa68
3 changed files with 9 additions and 9 deletions
|
@ -29286,7 +29286,7 @@ assert(tz.dstName == "PDT");
|
||||||
version(Posix)
|
version(Posix)
|
||||||
auto file = tzDatabaseDir ~ name;
|
auto file = tzDatabaseDir ~ name;
|
||||||
else version(Windows)
|
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.exists, new DateTimeException(format("File %s does not exist.", file)));
|
||||||
enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
|
enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));
|
||||||
|
@ -29595,10 +29595,10 @@ assert(tz.dstName == "PDT");
|
||||||
version(Posix)
|
version(Posix)
|
||||||
subName = strip(subName);
|
subName = strip(subName);
|
||||||
else version(Windows)
|
else version(Windows)
|
||||||
subName = replace(strip(subName), "/", sep);
|
subName = replace(strip(subName), "/", dirSeparator);
|
||||||
|
|
||||||
if(!tzDatabaseDir.endsWith(sep))
|
if(!tzDatabaseDir.endsWith(dirSeparator))
|
||||||
tzDatabaseDir ~= sep;
|
tzDatabaseDir ~= dirSeparator;
|
||||||
|
|
||||||
enforce(tzDatabaseDir.exists, new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
|
enforce(tzDatabaseDir.exists, new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
|
||||||
enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
|
enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));
|
||||||
|
|
|
@ -539,8 +539,8 @@ ulong getSize(in char[] name)
|
||||||
const (char)[] file = name[];
|
const (char)[] file = name[];
|
||||||
|
|
||||||
//FindFirstFileX can't handle file names which end in a backslash.
|
//FindFirstFileX can't handle file names which end in a backslash.
|
||||||
if(file.endsWith(sep))
|
if(file.endsWith(dirSeparator))
|
||||||
file.popBackN(sep.length);
|
file.popBackN(dirSeparator.length);
|
||||||
|
|
||||||
WIN32_FIND_DATAW filefindbuf;
|
WIN32_FIND_DATAW filefindbuf;
|
||||||
|
|
||||||
|
@ -1965,8 +1965,8 @@ else version(Windows)
|
||||||
_name = path.idup;
|
_name = path.idup;
|
||||||
|
|
||||||
//FindFirstFileX can't handle file names which end in a backslash.
|
//FindFirstFileX can't handle file names which end in a backslash.
|
||||||
if(_name.endsWith(sep))
|
if(_name.endsWith(dirSeparator))
|
||||||
_name.popBackN(sep.length);
|
_name.popBackN(dirSeparator.length);
|
||||||
|
|
||||||
WIN32_FIND_DATAW fd;
|
WIN32_FIND_DATAW fd;
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ version(Posix)
|
||||||
import core.stdc.errno;
|
import core.stdc.errno;
|
||||||
import core.sys.posix.pwd;
|
import core.sys.posix.pwd;
|
||||||
import core.sys.posix.stdlib;
|
import core.sys.posix.stdlib;
|
||||||
|
private import core.exception : onOutOfMemoryError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2795,7 +2796,6 @@ deprecated:
|
||||||
version(Posix)
|
version(Posix)
|
||||||
{
|
{
|
||||||
private import core.sys.posix.pwd;
|
private import core.sys.posix.pwd;
|
||||||
private import core.exception : onOutOfMemoryError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
version(Windows)
|
version(Windows)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue