ted
New Member
Posts: 4
|
Post by ted on Mar 9, 2007 11:07:13 GMT -5
When zipping to a flash drive the zip file is created but empty. What am I doing wrong?
|
|
|
Post by Kevin on Mar 13, 2007 16:40:53 GMT -5
Hi Ted,
Sorry, I just got back from a vacation where I had no access to a computer.
I am not sure why you would be having problems writing a zip file to a flash drive. I just tested it myself and it worked fine.
Are you still having problems? Are you able to do the exact same thing but to a normal hard drive?
Kevin
|
|
ted
New Member
Posts: 4
|
Post by ted on Mar 22, 2007 13:10:24 GMT -5
Kevin,
Yes, the same code works to the hard drive but changing the drive specifier to F or whatever results in an empty file.
Cheers,
Ted
|
|
|
Post by Kevin on Mar 22, 2007 19:10:02 GMT -5
Is your code simple enough that you can show it, or send me a small project that can duplicate the problem?
Kevin
|
|
ted
New Member
Posts: 4
|
Post by ted on Mar 23, 2007 10:33:25 GMT -5
Kevin
This is the code
with vclzip1 do begin ZipName:='?'; fileslist.add('*.txt'); fileslist.add('*.map'); fileslist.add('*.bmp'); excludelist.add('cr*.jpg'); zip; end;
If you choose the flash drive and empty zip is created but a proper zip appears when the hard drive is chosen.
Cheers,
Ted
PS delphi6
|
|
|
Post by skipper on Mar 24, 2007 18:44:38 GMT -5
Hi Ted,
Looking at your code, I am not sure why you have had a problem; as far as I can see it looks OK.
The only thing I would say is that I think (and Kevin, please correct me if I am wrong) VCLZip uses relative paths? Check your settings in Delphi - particularly the RelativePaths and RelativePathList. I have a sneaking suspicion that your code is syntatically OK, but that VCLZip is assuming that the files you want to zip / exclude are in the current folder, but that VCLZip cannot see them there?
Just a thought...
Alex.
|
|
|
Post by Kevin on Mar 24, 2007 22:36:02 GMT -5
Alex is right, you should always include the full path when putting filespecs into the FilesList, unless you also specify a RootDir. VCLZip does not use the currentdir because that would interfere with using VCLZip in threads.
I'm not sure if that has anything to do with the problem you are experiencing though, but it is possible.
Kevin
|
|
ted
New Member
Posts: 4
|
Post by ted on Mar 25, 2007 6:17:35 GMT -5
Thanks guys, I think I understand but I don't understand why I don't need to specify if zipping to c instead of f. Will experiment more.
|
|
|
Post by Kevin on Mar 28, 2007 21:36:07 GMT -5
Without putting the full path into the FilesList (or using RootDir), your application will blindly use where every YOU set the current directory too, possibly without even knowing it. Your application may be setting the current directory to the flash drive somehow and the files you are specifying are not on that drive.
That's my guess at least.
Kevin
|
|