That doesn't sound like the standard behaviour!

I tried

         FileInfo fi = new FileInfo(@"c:\temp\program.zip");
         fi.MoveTo(@"c:\temp\program.x86.zip");

It doesn't have any effect on the contents of the zip file.

Sounds like something has gone a little wrong with your compression...
all streams etc closed correctly?


On Thu, Jan 21, 2010 at 2:35 AM, Jeffrey Walton <[email protected]> wrote:
> Hi All,
>
> I have a program that I want to ZIP and then offer a link for
> download. When I rename the ZIP file, the file in the archive is also
> renamed. I've tried using Copy, Move, and Rename with no joy. In
> addition, .Net does a pretty shitty job at times for the inner file's
> rename - it drops the EXE extension.
>
> MyExe.exe -> Compress -> MyExe.exe.zip
>  - Inner file 'MyExe.exe' is OK
> MyExe.exe.zip -> Rename/Move/Copy -> MyExe.x86.zip
>  - Inner file 'MyExe.exe' inside MyExe.x86.zip is renamed to
> 'MyExe.x86'
>
> The files are being compressed with GZipStream, and I can't seem to
> find documentation on the behavior. The GZipStream docs does not even
> mention the word 'Rename' [1].
>
> Eventually, I require two files with similar names in the same
> directory:  MyExe.x86.zip and  MyExe.x64.zip. And I want both to unzip
> to 'MyExe.exe'.
>
> How do I rename *only* the ZIP file, and not the file inside the
> archive?
>
> Thanks,
> JW
>
> [1] 
> http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx
>

Reply via email to