Welcome! Log In Create A New Profile

Advanced

delete a zip file

Posted by emirhan 
emirhan
delete a zip file
February 10, 2009 04:24PM
Hi all,

I want to delete a zip file . I wrote the following code but it was not work,I could not understand my wrog, please help me. Thank you

zipDeleteAll("Backup") // the archive name is Backup
fDelete("C:\Backup.zip")
Stefan Bentvelsen
Re: delete a zip file
February 11, 2009 09:17AM
Hi emirhan,

may be the problem is that you did not zipClose() your archive so it is still in use ?
Merijn van der Wijk
Re: delete a zip file
February 11, 2009 09:17AM
Emirhan,

zipDeleteAll removes all files from the archive. After removing that archive is still opened by your application. To close i use a zipClose before the fDelete.

HTH
Merijn
Marc De Swert
Re: delete a zip file
February 11, 2009 11:28AM
Hi, this works fine for me

in a button i have the code
LOCAL
ResOpenZip is int
ZipPAth is string = "C:\TEMP\Backup.zip"

ResOpenZip = zipOpen("MonArchive", ZipPAth)
IF ResOpenZip = 0 THEN zipClose("MonArchive")
IF NOT fDelete(ZipPAth) THEN ErreurInfo(errMessage)


Marc :cool:
emirhan
Re: delete a zip file
February 12, 2009 09:28AM
Hi everybody,
I still could not solve the problem. I could not delete the zip file by using the following code;

ResOpenZip = zipOpen("Backup","C:\Backup.zip")
IF ResOpenZip = 0 THEN
zipClose("Backup")
END

IF NOT fDelete("C:\Backup.zip") THEN
ErrorInfo(errMessage)
END

I created the archive "Backup" before.

The error message is "Archive already found"
Marc De Swert
Re: delete a zip file
February 12, 2009 10:59AM
Strange,

I even used your code and it works!

Seems to that there is something hanging in Cache
or you don't have rights to delete file(s)

Try the following:
create an Backupzip file from a file with a different name like ToDeleteBackup.zip
and execute again with that name and us a different name for the openening

ResOpenZip = zipOpen("AnyName"; "C:\ToDeleteBackup.zip")

IF ResOpenZip = 0 THEN
zipClose("AnyName")
END


IF NOT fDelete("C:\ToDeleteBackup.zip") THEN
ErrorInfo(errMessage + cr + errComplet)
END


:cool: Marc

Marc De Swert
Re: delete a zip file
February 12, 2009 11:04AM
Create an bat file with the following code

@ECHO ON

REM delete the zip file
DEL C:\BACKUP.ZIP

PAUSE


name it DeleteZip.BAT and save in a folder you chooose, go to that folder

and click on it

when this process not delete the file you want, than you have no rights

MArc :cool:
Piet van Zanten
Re: delete a zip file
February 12, 2009 11:39AM
Hi,

:confused: zipDeleteAll("Backup")
Am I the only one that doesn't understand why you use zipdelete before deleting the zipfile?

Regards,
Piet
Louis Verbraak
Re: delete a zip file
February 12, 2009 01:51PM
Hello Emirhan,

I had a familiar problem with fDelete. fDelete gave me an error in a window with the Independent Hyperfile Context activated. When I deactivated that fDelete worked like expected. Don't ask me why, but it is worth trying.

HTH.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: