Página 1 de 1

TZIPFile Possible Bug

Publicado: Mié Abr 17, 2013 1:59 pm
por emeasoft
Hello Xailers,
I think there is an error when compacting files with tzipfile class... The problem is that it does not include the path when compacting, it just adds all files in one folder, ignoring the property.
The property lRecurse is not working too.
Is this a bug?
TIA,
Juliano

Attached files TZipFile.zip (7 KB)Â

TZIPFile Possible Bug

Publicado: Mié Abr 17, 2013 4:17 pm
por ignacio
Dear Sir,
Export a project within Xailer and you will see that the paths are saved correctly. The IDE uses exactly the same class with no modifications.
BTW, the sample TestZip from SamplesZipArchive directory works also as expected.
Regards,

TZIPFile Possible Bug

Publicado: Mié Abr 17, 2013 4:54 pm
por emeasoft
Hello Ignacio,
Thanks for the help. But the error happens when I add some diferent mask to the filter.
eg.: in the sample, change the line 114 to cSrcFile := ::oEdit1:cText + "*.xfm", it will not scan the folders for xfm files and will give you an error.
TIA,
Juliano

TZIPFile Possible Bug

Publicado: Mié Abr 17, 2013 6:01 pm
por ignacio
Hello,
Problem solved. This is the corrected code on module ZipArchive.prg:
STATIC FUNCTION RecurseDir( cMask, lRecursive, aFiles )
LOCAL aDir, aFile
LOCAL cPath, cFile
DEFAULT aFiles TO {}, lRecursive TO .F.
aDir := Directory( cMask )
cPath := FilePath( cMask )
cMask := FileFullname( cMask )

FOR EACH aFile IN aDir
cFile := aFile[ F_NAME ]
AAdd( aFiles, cPath + "" + cFile )
NEXT

IF lRecursive
aDir := Directory( cPath + "*.*", "D" )
FOR EACH aFile IN aDir
cFile := aFile[ F_NAME ]
IF "D" $ aFile[ F_ATTR ] .AND. cFile != "." .AND. cFile != ".."
RecurseDir( cPath + "" + cFile + "" + cMask, .T., @aFiles )
ENDIF
NEXT
ENDIF
RETURN aFiles
BTW, we plan to update Xailer 3 to 3.1 tomorrow. In case you can wait.
Regards,

TZIPFile Possible Bug

Publicado: Mié Abr 17, 2013 6:34 pm
por emeasoft
Thanks Ignacio! We will wait for the version tomorrow!
Regards,
Juliano

TZIPFile Possible Bug

Publicado: Mié Abr 17, 2013 7:18 pm
por ignacio
emeasoft escribió el mié, 17 abril 2013 18:34Thanks Ignacio! We will wait for the version tomorrow!
Regards,
Juliano
Should have said 3.0.2
Regards,

TZIPFile Possible Bug

Publicado: Jue Abr 18, 2013 2:10 pm
por emeasoft
Hello Ignacio,
Upon some more testing, I found one more error...
The property lIncludePath is not fully working, it is not including the full file path.
eg.: I want to compact all the xfm files in my project 1 folder and all the xfm from my project folder 2.
1- all xfm from C:Project1*.xfm
2- all xfm from C:Project2*.xfm
The final zip dir structure is like this sourcexfm_from_all_projects (ZipExample1) instead of a structure like Project1sources...xfm and Project2sources...xfm(ZipExample2)
TIA,
Juliano


Attached files ZipExample1.zip (817 B)Â ZipExample2.zip (1.4 KB)Â

TZIPFile Possible Bug

Publicado: Vie Abr 19, 2013 10:10 am
por ignacio
emeasoft escribió el jue, 18 abril 2013 14:10Hello Ignacio,
Upon some more testing, I found one more error...
The property lIncludePath is not fully working, it is not including the full file path.
eg.: I want to compact all the xfm files in my project 1 folder and all the xfm from my project folder 2.
1- all xfm from C:Project1*.xfm
2- all xfm from C:Project2*.xfm
The final zip dir structure is like this sourcexfm_from_all_projects (ZipExample1) instead of a structure like Project1sources...xfm and Project2sources...xfm(ZipExample2)
TIA,
Juliano
Hello,
On those cases you must use the property lIncludeDrive to .T.
Regards,

TZIPFile Possible Bug

Publicado: Lun Abr 22, 2013 1:59 pm
por emeasoft
Hello Ignacio,
Using includeDrive will add the drive to the zip, but we do not want this... To correct the problem I just changed the line 135 cFile := SubStr( cFile, Len( cPath ) + 2 ) to cFile := SubStr( cFile, 3 ).
The problem is that when you want to compact a folder, it compacts the content of the folder only.
eg.: Right mouse click on a folder on your desktop > send to > zip folder, this is how it should work...
TIA,
Juliano

TZIPFile Possible Bug

Publicado: Lun Abr 22, 2013 4:28 pm
por ignacio
emeasoft escribió el lun, 22 abril 2013 13:59Hello Ignacio,
Using includeDrive will add the drive to the zip, but we do not want this... To correct the problem I just changed the line 135 cFile := SubStr( cFile, Len( cPath ) + 2 ) to cFile := SubStr( cFile, 3 ).
The problem is that when you want to compact a folder, it compacts the content of the folder only.
eg.: Right mouse click on a folder on your desktop > send to > zip folder, this is how it should work...
TIA,
Juliano
If that fixes your requirements go ahead y believe it does not the job correctly but maybe I'm wrong, for example:
Mask 1) c:tempproject1*.*
Mask 2) c:tempproject2*.*
Which is the root path?
temp
Now this one:
Mask 1) c:tempproject1*.*
Mask 2) c:temp2project2*.*
Which is the root path?
????
Regards,