2 /* Invisible Vector Library
3 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
4 * Understanding is not required. Only obedience.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, version 3 of the License ONLY.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 public import iv
.vfs
.arc
.abuse
;
21 public import iv
.vfs
.arc
.arcanum
;
22 public import iv
.vfs
.arc
.arcz
;
23 public import iv
.vfs
.arc
.bsa
;
24 public import iv
.vfs
.arc
.dfwad
;
25 //public import iv.vfs.arc.dunepak; no signature
26 //public import iv.vfs.arc.f2dat; // no signature
27 //public import iv.vfs.arc.toeedat; // conflicts with arcanum
28 public import iv
.vfs
.arc
.wad2
;
31 __gshared
ubyte[1024*1024] buf
;
34 void extractFile (const(char)[] fname
) {
35 import std
.file
: mkdirRecurse
;
36 import std
.path
: dirName
;
38 auto fl
= VFile(fname
);
40 string destname
= "_unp/"~fname
.idup
;
41 mkdirRecurse(destname
.dirName
);
42 auto fo
= VFile(destname
, "w");
44 auto rd
= fl
.rawRead(buf
);
45 if (rd
.length
== 0) break;
49 } catch (Exception e
) {
56 void main (string
[] args
) {
57 if (args
.length
< 2) assert(0, "PAK?");
59 string aname
= args
[1];
62 } catch (Exception e
) {
63 writeln("ERROR adding archive '", aname
, "'!");
67 if (args
.length
> 2) {
68 foreach (string fname
; args
[2..$]) {
69 write("extracting '", fname
, "' ... ");
73 foreach_reverse (const ref de; vfsFileList
) {
74 write("extracting '", de.name
, "' ... ");