Skip to content

Commit c38c6f4

Browse files
committed
Zip64 extensions now default to off which is the most compatible method for current tools.
Some unchecked tweaks although this is a long way off complete. zf sample tweaked to allow setting of UseZip64 property so its effect can be seen.
1 parent 69977ba commit c38c6f4

File tree

19 files changed

+93
-36
lines changed

19 files changed

+93
-36
lines changed

samples/cs/CreateZipFile/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyTrademark("")]
1111
[assembly: AssemblyCulture("")]
1212

13-
[assembly: AssemblyVersion("0.85.1.268")]
13+
[assembly: AssemblyVersion("0.85.1.269")]
1414

1515
[assembly: AssemblyDelaySign(false)]
1616
[assembly: AssemblyKeyFile("")]

samples/cs/FastZip/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// You can specify all values by your own or you can build default build and revision
2424
// numbers with the '*' character (the default):
2525

26-
[assembly: AssemblyVersion("0.85.1.268")]
26+
[assembly: AssemblyVersion("0.85.1.269")]
2727

2828
// The following attributes specify the key for the sign of your assembly. See the
2929
// .NET Framework documentation for more information about signing.

samples/cs/minibzip2/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyTrademark("")]
1111
[assembly: AssemblyCulture("")]
1212

13-
[assembly: AssemblyVersion("0.85.1.268")]
13+
[assembly: AssemblyVersion("0.85.1.269")]
1414

1515
[assembly: AssemblyDelaySign(false)]
1616
[assembly: AssemblyKeyFile("")]

samples/cs/minigzip/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyTrademark("")]
1111
[assembly: AssemblyCulture("")]
1212

13-
[assembly: AssemblyVersion("0.85.1.268")]
13+
[assembly: AssemblyVersion("0.85.1.269")]
1414

1515
[assembly: AssemblyDelaySign(false)]
1616
[assembly: AssemblyKeyFile("")]

samples/cs/samples.build

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<echo message="Building CreateZipFile example"/>
1818
<copy todir="bin">
1919
<fileset basedir="../../bin/ICSharpCode.SharpZipLib">
20-
<include name="ICSharpCode.SharpZipLib.dll"/>
21-
</fileset>
20+
<include name="ICSharpCode.SharpZipLib.dll"/>
21+
</fileset>
2222
</copy>
2323

2424
<csc
@@ -153,6 +153,20 @@
153153
<include name="ICSharpCode.SharpZipLib.dll"/>
154154
</references>
155155
</csc>
156+
157+
<!-- Compile FastZip sample -->
158+
<echo message="Building FastZip sample"/>
159+
<csc
160+
target="exe"
161+
output="bin/fastzip.exe"
162+
debug="False">
163+
<sources basedir="fastzip">
164+
<include name="**/*.cs"/>
165+
</sources>
166+
<references basedir="bin">
167+
<include name="ICSharpCode.SharpZipLib.dll"/>
168+
</references>
169+
</csc>
156170
</target>
157171

158172
<target name="clean">

samples/cs/sz/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// You can specify all values by your own or you can build default build and revision
2424
// numbers with the '*' character (the default):
2525

26-
[assembly: AssemblyVersion("0.85.1.268")]
26+
[assembly: AssemblyVersion("0.85.1.269")]
2727

2828
// The following attributes specify the key for the sign of your assembly. See the
2929
// .NET Framework documentation for more information about signing.

samples/cs/tar/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// You can specify all values by your own or you can build default build and revision
2424
// numbers with the '*' character (the default):
2525

26-
[assembly: AssemblyVersion("0.85.1.268")]
26+
[assembly: AssemblyVersion("0.85.1.269")]
2727

2828
// The following attributes specify the key for the sign of your assembly. See the
2929
// .NET Framework documentation for more information about signing.

samples/cs/zf/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// You can specify all the values or you can default the Revision and Build Numbers
2727
// by using the '*' as shown below:
2828

29-
[assembly: AssemblyVersion("0.85.1.268")]
29+
[assembly: AssemblyVersion("0.85.1.269")]
3030

3131
//
3232
// In order to sign your assembly you must specify a key to use. Refer to the

samples/cs/zf/zf.cs

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
//
88
//------------------------------------------------------------------------------
99
// Version History
10-
// 0.1 Initial version ported from sz sample. Some stuff is not used or commented still
11-
// 0.2 Display files during extract. --env Now shows .NET version information.
10+
// 1 Initial version ported from sz sample. Some stuff is not used or commented still
11+
// 2 Display files during extract. --env Now shows .NET version information.
12+
// 3 Add usezip64 option as a testing aid.
1213

1314

1415
using System;
@@ -102,7 +103,7 @@ bool SetArgs(string[] args)
102103

103104
#if OPTIONTEST
104105
Console.WriteLine("args index [{0}] option [{1}] argument [{2}]", argIndex, option, optArg);
105-
#endif
106+
#endif
106107
if (option.Length == 0)
107108
{
108109
System.Console.Error.WriteLine("Invalid argument (0}", args[argIndex]);
@@ -115,7 +116,7 @@ bool SetArgs(string[] args)
115116
{
116117
#if OPTIONTEST
117118
Console.WriteLine("optionIndex {0}", optionIndex);
118-
#endif
119+
#endif
119120
switch(option[optionIndex])
120121
{
121122
case '-': // long option
@@ -163,6 +164,26 @@ bool SetArgs(string[] args)
163164
testData_ = true;
164165
break;
165166

167+
case "-zip64":
168+
if ( optArg.Length > 0 )
169+
{
170+
switch ( optArg )
171+
{
172+
case "on":
173+
useZip64_ = UseZip64.On;
174+
break;
175+
176+
case "off":
177+
useZip64_ = UseZip64.Off;
178+
break;
179+
180+
case "auto":
181+
useZip64_ = UseZip64.Dynamic;
182+
break;
183+
}
184+
}
185+
break;
186+
166187
case "-encoding":
167188
if (optArg.Length > 0)
168189
{
@@ -175,7 +196,7 @@ bool SetArgs(string[] args)
175196
{
176197
#if OPTIONTEST
177198
Console.WriteLine("Encoding set to {0}", enc);
178-
#endif
199+
#endif
179200
ZipConstants.DefaultCodePage = enc;
180201
}
181202
else
@@ -340,7 +361,7 @@ bool SetArgs(string[] args)
340361
{
341362
#if OPTIONTEST
342363
Console.WriteLine("file spec {0} = '{1}'", argIndex, args[argIndex]);
343-
#endif
364+
#endif
344365
fileSpecs_.Add(args[argIndex]);
345366
}
346367
++argIndex;
@@ -350,7 +371,7 @@ bool SetArgs(string[] args)
350371
{
351372
string checkPath = (string)fileSpecs_[0];
352373
int deviceCheck = checkPath.IndexOf(':');
353-
#if NET_VER_1
374+
#if NET_VER_1
354375
if (checkPath.IndexOfAny(Path.InvalidPathChars) >= 0
355376
#else
356377
if (checkPath.IndexOfAny(Path.GetInvalidPathChars()) >= 0
@@ -396,7 +417,7 @@ void ShowEnvironment()
396417
void ShowVersion()
397418
{
398419
seenHelp_ = true;
399-
Console.Out.WriteLine("ZipFile Archiver v0.2 Copyright 2006 John Reilly");
420+
Console.Out.WriteLine("ZipFile Archiver v0.3 Copyright 2006 John Reilly");
400421

401422
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
402423

@@ -440,6 +461,7 @@ void ShowHelp()
440461
Console.Out.WriteLine("--version Show version information");
441462
Console.Out.WriteLine("-r Recurse sub-folders");
442463
Console.Out.WriteLine("-s=password Set archive password");
464+
Console.Out.WriteLine("--zip64=[on|off|auto] Zip64 extension handling to use");
443465

444466

445467
/*
@@ -621,6 +643,8 @@ void Create(ArrayList fileSpecs)
621643
using (ZipFile zf = ZipFile.Create(zipFileName) )
622644
{
623645
zf.Password = password_;
646+
zf.UseZip64 = useZip64_;
647+
624648
zf.BeginUpdate();
625649

626650
activeZipFile_ = zf;
@@ -678,7 +702,7 @@ bool ExtractFile(Stream inputStream, ZipEntry theEntry, string targetDir)
678702
#if TEST
679703
Console.WriteLine("Decompress targetfile name " + entryFileName);
680704
Console.WriteLine("Decompress targetpath " + fullPath);
681-
#endif
705+
#endif
682706

683707
// Could be an option or parameter to allow failure or try creation
684708
if (Directory.Exists(fullPath) == false)
@@ -1009,6 +1033,8 @@ void Add(ArrayList fileSpecs)
10091033
using (zipFile)
10101034
{
10111035
zipFile.Password = password_;
1036+
zipFile.UseZip64 = useZip64_;
1037+
10121038
zipFile.BeginUpdate();
10131039

10141040
activeZipFile_ = zipFile;
@@ -1390,6 +1416,11 @@ public static void Main(string[] args)
13901416
/// The size of buffer to provide. <see cref="GetBuffer"></see>
13911417
/// </summary>
13921418
int bufferSize_ = 4096;
1419+
1420+
/// <summary>
1421+
/// The Zip64 extension use to apply.
1422+
/// </summary>
1423+
UseZip64 useZip64_ = UseZip64.Off;
13931424
#endregion
13941425
}
13951426
}

src/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
[assembly: AssemblyTrademark("")]
5050
[assembly: AssemblyCulture("")]
5151

52-
[assembly: AssemblyVersion("0.85.1.268")]
52+
[assembly: AssemblyVersion("0.85.1.269")]
5353

5454
// Setting ComVisible to false makes the types in this assembly not visible
5555
// to COM components. If you need to access a type in this assembly from

0 commit comments

Comments
 (0)