-
Oct 20th, 2017, 07:09 AM
#1
Thread Starter
PowerPoster
HOW TO CREATE an empty zip file
HOW TO CREATE an empty zip file in c:\myzipfile\?
-
Oct 20th, 2017, 07:16 AM
#2
Re: HOW TO CREATE an empty zip file
The same way you would create any other file
Code:
open "c:\myzipfile\SomeFile.zip" for output as #1
close #1
-
Oct 20th, 2017, 07:17 AM
#3
Re: HOW TO CREATE an empty zip file
Originally Posted by DataMiser
The same way you would create any other file
Code:
open "c:\myzipfile\SomeFile.zip" for output as #1
close #1
Although if it is going to be empty then there is no much point in having it
-
Oct 20th, 2017, 08:24 AM
#4
Re: HOW TO CREATE an empty zip file
An empty zip file has the same signature (20 Bytes i think). you can right click in explorer or your desktop and create a new empty zip file, to get the signature.
Code:
Open "SomeFile.zip" For Output As #1
Print #1, "PK" & Chr(5) & Chr(6) & String$(18, 0);
Close #1
Last edited by DEXWERX; Oct 20th, 2017 at 09:23 AM.
Reason: shortened even further...
-
Oct 21st, 2017, 02:39 PM
#5
Re: HOW TO CREATE an empty zip file
Hi,
this is one way..
Code:
Private Sub Command1_Click()
createZipFile "C:\myFirstZip.zip"
End Sub
Public Sub createZipFile(ByVal fileName As String)
Dim fileNo As Integer
Dim ZIPFileEOCD(22) As Byte
'Signature of the EOCD: &H06054b50
ZIPFileEOCD(0) = Val("&H50")
ZIPFileEOCD(1) = Val("&H4b")
ZIPFileEOCD(2) = Val("&H05")
ZIPFileEOCD(3) = Val("&H06")
fileNo = FreeFile
Open fileName For Binary Access Write As #fileNo
Put #fileNo, , ZIPFileEOCD
Close #fileNo
End Sub
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|