Virtualfile question
Posted: Tue Jun 29, 2021 1:04 pm
I have this function that should read a directory and pack all .dat files into a virtual zip file, and then upload it to my ftp server.
My resulting zip file does apear on the server, so it apear to work.
But I found there is a file named 0 that is created in the progdir every time the function runs, which is the same file as my uploaded zipfile.
Looking at my code, I found I must have made a copy/paste mistake when writing the line that defines the virtual file. (first line in the example code below) I figured I just needed to remove that part which says "statusfil$ =", but then it will not work at all.
The variable statusfil$ is used for something else another place in my script, but is unused at the time this code below is executed, so it contains Nil
What is
My resulting zip file does apear on the server, so it apear to work.
But I found there is a file named 0 that is created in the progdir every time the function runs, which is the same file as my uploaded zipfile.
Looking at my code, I found I must have made a copy/paste mistake when writing the line that defines the virtual file. (first line in the example code below) I figured I just needed to remove that part which says "statusfil$ =", but then it will not work at all.
The variable statusfil$ is used for something else another place in my script, but is unused at the time this code below is executed, so it contains Nil
What is
Code: Select all
brettarkiv$ = statusfil$ = DefineVirtualFileFromString("", "bingobrett.zip", True)
zip.OpenArchive(1, brettarkiv$,#MODE_WRITE)
For s$ In DirectoryItems(brettmappe$)
brettfil$ = brettmappe$.."/"..s$
If FindStr(brettfil$, ".dat")
zip.AddFile(1, brettfil$)
EndIf
Next
zip.CloseArchive(1)
UploadFile(serverbrettfil$, {File = brettarkiv$})