Re: Is there a std.zip.ZipArchive isDir or isFile method?

2020-02-12 Thread cc via Digitalmars-d-learn
It looks like 004 (octal) is the flag for directories on linux, but it does seem that std.zip is explicitly returning 0 if the file was created on the opposite platform re: Posix vs Windows, which is... odd. @property @nogc nothrow uint fileAttributes() const { version (Posix) {

Re: Is there a std.zip.ZipArchive isDir or isFile method?

2020-02-11 Thread mark via Digitalmars-d-learn
On Wednesday, 12 February 2020 at 05:59:53 UTC, cc wrote: On Monday, 3 February 2020 at 13:26:38 UTC, mark wrote: I'm using std.zip.ZipArchive to read zip files, e.g.: [snip] I couldn't find one either, I had to do this: version(Windows) { enum uint FILE_ATTRIBUTE_DIRECTORY = 0x10; }

Re: Is there a std.zip.ZipArchive isDir or isFile method?

2020-02-11 Thread cc via Digitalmars-d-learn
On Monday, 3 February 2020 at 13:26:38 UTC, mark wrote: I'm using std.zip.ZipArchive to read zip files, e.g.: auto zip = new ZipArchive(read(filename)); // ... foreach (name, member; zip.directory) { if (name.endsWith('/')) // skip dirs continue;

Re: Is there a std.zip.ZipArchive isDir or isFile method?

2020-02-03 Thread JN via Digitalmars-d-learn
On Monday, 3 February 2020 at 13:26:38 UTC, mark wrote: I'm using std.zip.ZipArchive to read zip files, e.g.: auto zip = new ZipArchive(read(filename)); // ... foreach (name, member; zip.directory) { if (name.endsWith('/')) // skip dirs continue;

Is there a std.zip.ZipArchive isDir or isFile method?

2020-02-03 Thread mark via Digitalmars-d-learn
I'm using std.zip.ZipArchive to read zip files, e.g.: auto zip = new ZipArchive(read(filename)); // ... foreach (name, member; zip.directory) { if (name.endsWith('/')) // skip dirs continue; mkdirRecurse(dirName(name)); zip.expand(member);