Skip to content

Commit

Permalink
replace deprecated std.zip.ArchiveMember.madeVersion with fileAttributes
Browse files Browse the repository at this point in the history
- unconditionally replace backslashes
  • Loading branch information
MartinNowak committed Jul 7, 2014
1 parent cf1e9b3 commit b8c71af
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions create_dmd_release/common.d
Expand Up @@ -101,10 +101,7 @@ void extractZip(string archive, string outputDir)
{
if(!am.expandedSize) continue;

const os = am.fileAttributes & 0xFF00;
const fromWindows = os == 0x0000 || os == 0x0b00;

string path = buildPath(outputDir, fromWindows ? replace(name, "\\", "/") : name);
string path = buildPath(outputDir, name.replace("\\", "/"));
auto dir = dirName(path);
if (dir != "" && !dir.exists)
mkdirRecurse(dir);
Expand All @@ -113,8 +110,8 @@ void extractZip(string archive, string outputDir)
import std.datetime : DosFileTimeToSysTime;
auto mtime = DosFileTimeToSysTime(am.time);
setTimes(path, mtime, mtime);
version (Posix) if (fromWindows) continue;
std.file.setAttributes(path, am.fileAttributes);
if (auto attrs = am.fileAttributes)
std.file.setAttributes(path, attrs);
}
}

Expand Down

0 comments on commit b8c71af

Please sign in to comment.