Zipping from foxpro

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

kensands

Thread Starter
Joined
Sep 17, 2004
Messages
7
I'm using the following code to zip files from foxpro using powerarchiver as my zipper, I'm having problems with any paths that have spaces even though I am trying to pass quoted paths, any ideas?

parameters filetozip,ziptoname,zippassword

filetozip = '"'+filetozip+'"'
ziptoname = '"'+ziptoname+'"'
if zippassword != ""
zippassword = '-s"'+zippassword+'"' && putting the -s part in here stops it failing when no password is passed.
endif
run C:\PACL\PACOMP -a -c2 -w -q &zippassword &ziptoname &filetozip

return


it works fine as long as there are no spaces in the paths passed but this is not good enough for my needs.

Thanks in advance.
Ken.
 

kensands

Thread Starter
Joined
Sep 17, 2004
Messages
7
if anyone can point me toward a free zip program with an open com interface that I can use programmaticaly that would do fine.

cheers.
 

kensands

Thread Starter
Joined
Sep 17, 2004
Messages
7
Thanks I'll give it a go, I've tried 7-zip, izarc, camunzip, and ofcourse powerarchiver with no success so far, unzipping has been fine it's just zipping, I've found I can zip as long as both input and zip fle are 8 characters or less but this is not nearly sufficient.

I'll report back on how pkzip goes, it may well be a fox issue.
 

kensands

Thread Starter
Joined
Sep 17, 2004
Messages
7
ok still having issues, can someone help me out here?

I need to zip a long filenamed file with possible spaces from a network drive to a different network drive long named possible spaced zip file.... Phew... breathe....

so in fox using any zip program you like, preferably free, since there are plenty of free ones zip me up a:
G:\some directory\in a long path\long filename file.txt
to a
H:\another directory\also pretty long\nice long zipname.zip

when I try it either the run command fails or it flips up the black command box real quick and obviously fails to do anything. (made even more obvious by the lack of resulting zip file)

I'd also prefer it to work without the /N bit after RUN, because if it does not wait it will try to kick into a second zip process which will probably fail (trying to zip to the same zip file on a second run is possible)

ok challenge set, how hard can it be???
 

kensands

Thread Starter
Joined
Sep 17, 2004
Messages
7
Ok I think I'm there now. seems the issues were mainly down to me not being careful enough with spaces and the use of /N

so I've got it working with /N and added a keyin() wait based on the 3meg per sec zip speed my computer manages + a bit for safety, yes I know thats a pretty crappy way, but it'll do for now and I'll make it look for the process to have finished soon.

thats easy right?

cheers.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top