mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Update win32 for Path::getStatusInfo
llvm-svn: 29401
This commit is contained in:
parent
d7873a0757
commit
e2c3df81b7
@ -333,11 +333,12 @@ Path::getLast() const {
|
||||
return path.substr(pos+1);
|
||||
}
|
||||
|
||||
void
|
||||
Path::getStatusInfo(StatusInfo& info) const {
|
||||
bool
|
||||
Path::getStatusInfo(FileStatus &info, std::string *ErrStr) const {
|
||||
WIN32_FILE_ATTRIBUTE_DATA fi;
|
||||
if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi))
|
||||
ThrowError("getStatusInfo():" + std::string(path) + ": Can't get status: ");
|
||||
return GetError("getStatusInfo():" + std::string(path) +
|
||||
": Can't get status: ", ErrStr);
|
||||
|
||||
info.fileSize = fi.nFileSizeHigh;
|
||||
info.fileSize <<= sizeof(fi.nFileSizeHigh)*8;
|
||||
@ -351,6 +352,7 @@ Path::getStatusInfo(StatusInfo& info) const {
|
||||
info.modTime.fromWin32Time(ft);
|
||||
|
||||
info.isDir = fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool AddPermissionBits(const std::string& Filename, int bits) {
|
||||
@ -691,7 +693,7 @@ Path::renamePathOnDisk(const Path& newName) {
|
||||
}
|
||||
|
||||
bool
|
||||
Path::setStatusInfoOnDisk(const StatusInfo& si) const {
|
||||
Path::setStatusInfoOnDisk(const FileStatus &si) const {
|
||||
// FIXME: should work on directories also.
|
||||
if (!isFile()) return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user