Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfpcompression.fll issue
Message
From
28/12/2018 15:48:46
 
 
To
28/12/2018 13:43:33
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01664913
Message ID:
01664926
Views:
78
>I have been using the vfpCompression.fll to create backups. I noticed if the being backup-ed begins with an underscore (ie _Command.prg), the file does get included in the Zip file. No error is reported, just not included. I have searched Sweetpotato web site, but have not seen any mentioned of this. I began noticing this when I employed the _.prg to my project. (there are a few files that begin with '_' ).
>
>Does anyone have any comments or suggestion on how to correct this?

Something I would try as a quick-and-dirty work-around (but see below, there is likely a better solution).

Do an ADIR() to get a list of files in each folder. If any of them have an underscore, replace it (untested, off the top of my head, needs adjusting on how to do the renames I'm sure):
IF NOT USED("c_renames")
    CREATE CURSOR c_renames (cOldName c(240), cNewName c(240))
ENDIF

ADIR(laFiles, "*.*")
FOR lnI = 1 TO ALEN(laFiles, 1)
    IF "_" $ laFiles[lnI, 1]
        INSERT INTO c_renames (cOldName, cNewName) ;
                VALUES(FULLPATH(laFiles[lnI, 1]), ;
                       FORCEPATH(STRTRAN(laFiles[lnI, 1], "_", "%" + TRANSFORM(ASC("_"))), JUSTPATH(FULLPATH(laFiles[lnI, 1])))
        RENAME (JUSTFNAME(ALLTRIM(cOldName))) TO (JUSTFNAME(ALLTRIM(cNewName)))
    ENDIF
NEXT

* Perform backup

* Rename them back afterward
SELECT c_renames
SCAN
    CD (JUSTPATH(ALLTRIM(cNewName)))
    RENAME (JUSTFNAME(ALLTRIM(cNewName))) TO (JUSTFNAME(ALLTRIM(cOldName)))
ENDSCAN
It's dangerous to do that. If there's an error in the middle you would need some way to unwind your progress, so it may be worth using a permanent table, and keeping track of your progress if you want to pursue this method.

I would sooner suggest using another compression utility however. I have used 7-Zip for many years. It's free and it's performs flawlessly (version 9.02 and later). You can run it with command-line options, and there's a DLL if you want to integrate it that way. We've used it with command line options, and I wrote a launcher wrapper to intercept the command window's output so we can parse it in real-time and provide a progress bar.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform