When I write Zip files with the Packer they do not seem to have the usual Zip signature: PK as the first to bytes.
Am I doing something wrong or is there a way to add the two or four signature bytes?
Help with Packer, please. - Zip signature
Re: Help with Packer, please. - Zip signature
Normally I don't test anything without a 'not working' example.
But since it's only a tiny code:
If I open the file c:\tmp\test.zip with a hex viewer it starts with PK.
So again: without your code wich is not working ...
But since it's only a tiny code:
Code: Select all
UseZipPacker()
If CreatePack(0, "c:\tmp\test.zip")
ClosePack(0)
EndIf
So again: without your code wich is not working ...
Re: Help with Packer, please. - Zip signature
@infratec,
Thank you for taking the trouble to help.
Apologies for not supplying a code sample.
Since it is obvious that my code is bad, I'll go away and try to set it aright.
Thank you for taking the trouble to help.
Apologies for not supplying a code sample.
Since it is obvious that my code is bad, I'll go away and try to set it aright.
DE AA EB
Re: Help with Packer, please. - Zip signature
Code: Select all
; TOP by mk-soft
DataSection
EmptyZip:
Data.a 'P', 'K', 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
EndEmptyZip:
EndDataSection
Procedure CreateEmptyZipFile(FileName.s)
Protected file
file = CreateFile(#PB_Any, FileName)
If file
WriteData(file, ?EmptyZip, 22)
CloseFile(file)
ProcedureReturn #True
Else
ProcedureReturn #False
EndIf
EndProcedure
f.s = SaveFileRequester("Save", "", "*.zip", 0)
If f
CreateEmptyZipFile(f)
EndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive