Page 1 of 1

delete a file

Posted: Thu Oct 31, 2024 1:10 pm
by Silvio.Falconi
I t ried with FERASE( cFile ) or DELETEFILE( cFile ) with no success!!!

How I can resolve ?

Re: delete a file

Posted: Thu Oct 31, 2024 2:00 pm
by MarcoBoschi
Silvio,
what return code do you have?

Re: delete a file

Posted: Thu Oct 31, 2024 2:25 pm
by Rick Lipkin
SIlvo

Are you sure cFile contains the full path of the file you wish to delete ... cfile := "c:\mydata\main.exe" the ferase( cFIle ) should work.

Rick Lipkin

Re: delete a file

Posted: Thu Oct 31, 2024 2:41 pm
by nageswaragunupudi

Code: Select all | Expand

if FErase( cFile ) != 0
? FError()
endif

Re: delete a file

Posted: Thu Oct 31, 2024 4:03 pm
by Silvio.Falconi
nageswaragunupudi wrote:

Code: Select all | Expand

if FErase( cFile ) != 0
? FError()
endif
Give me error 32 and not delete the file

I created the file on root of exe , and i must delete the file because It change each time i make a operation

Re: delete a file

Posted: Thu Oct 31, 2024 4:11 pm
by Otto
Silvio, DOS Error 32 is"Sharing violation".
Best regards,
Otto

Re: delete a file

Posted: Thu Oct 31, 2024 5:24 pm
by Silvio.Falconi
I create the file With Fopen
Then i create adata from this file and close It With fclose
Then i Wish delete It show adata With xbrowse

Witch sharing violation i made ?