1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Zipping from foxpro

Discussion in 'Software Development' started by kensands, Sep 17, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. kensands

    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.
     
  2. kensands

    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.
     
  3. Chicon

    Chicon

    Joined:
    Jul 29, 2004
    Messages:
    6,650
  4. kensands

    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.
     
  5. kensands

    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???
     
  6. kensands

    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.
     
  7. Sponsor

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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/275034

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice