Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get file's length and date from zip
#8
The macro above works in QM (2.4.6.1)
But when I compile to .exe and then move exe to other location, I get the error:
Dll not found: qmzip

Within QM I created a folder and placed the macro and other component 'qmzip_def'.
Running macro from QM works but compiling macro to .exe and placing .exe at other location I get: Dll not found: qmzip

I slightly modified macro:

Macro qmzip_test
Code:
Copy      Help
out
str zip_path="E:\__qm_testdirs\_rotation_scripts\test_contents.zip" ;; ===> SLIGHT modification, added path to zip here...


ref qmzip qmzip_def

str zf.searchpath(zip_path)
if(!zf) end "zip file not found"

int hzip=qmzip.OpenZip(zf.unicode 0 ZIP_FILENAME)
if(!hzip) end "failed"
;note: in QM 2.3.0 and later, with OpenZip and CreateZip, file name must be Unicode UTF-16

ZIPENTRY z
int i n
int zr=qmzip.GetZipItem(hzip -1 &z); if(zr) goto g1 ;;call with index -1 to get info about the zip file, particularly number of items
n=z.index

for i 0 n
,zr=qmzip.GetZipItem(hzip i &z); if(zr) goto g1
,lpstr name=&z.name
,DATE d1.fromfiletime(z.mtime); str sd1.time(d1 "%x %H:%M")
,out "name=''%s'', size=%i, compressed size=%i, date modified=%s" name z.unc_size z.comp_size sd1

;g1
qmzip.CloseZip(hzip)
if(zr) end "failed"


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)