Long entry name saving.

Feb 4, 2010 at 4:05 PM

If we have an entry with a long name like:

C:\Documents and Settings\user\My Documents\Presentations\Press\Life-Processes-StandAlonePresent-Security-2\Life process- Introduction\New Folder\0.zip

 

How to save to a temp location:

c:\temp\0.zip

 

The issue we are having is it ends up saving all the dirs in temp folder when we save it.

Please let me know if you have any suggestions.

Thanks

N

 

Coordinator
Feb 4, 2010 at 10:34 PM
Edited Feb 4, 2010 at 10:37 PM

I think I don't understand the question, because it seems like it should be a very simple answer.

If you have a file at c:\very log path\etc\etc\0.zip

and you want the file to be at c:\temp\0.zip

can you not simply copy the file?  File.Copy() ??

Because it is so simple and obvious, I'm sure I'm misunderstanding what you are asking.

Feb 5, 2010 at 2:11 AM

Sorry about that. I forgot to mention that the source and destination computers are different.

It will be created in the Source computer (Developer computer).

It will be shipped and extracted in users computers but would like to avoid the long entry names.

Thanks

Coordinator
Feb 5, 2010 at 11:26 AM

I'm sure I still don't understand the problem.  If they are on different computers, then you have to copy the file across the network.

It seems you are asking about how to copy files from one filesystem to another.   If this is a DotNetZip question, you need to ask it more clearly.

I think maybe you want to create a zipfile and specify directory paths for each entry in the zip file.  This has nothing to do with the path of the zipfile itself.

There are parameters in the various AddFiles(), AddDirectory(), AddSelectedFiles() methods that allow you to specify a directory path to use within the archive.  This param is often called directoryInArchive.  Consult the doc, give it a try, and ask if you get hung up.