PDA

View Full Version : File_kill



cjungbauer
09-11-2009, 13:17
Hello

Im using the following code to kill a file

fn = APP_SourcePath + "log\h2o_use_" & admin(1) & ".txt"

If FILE_EXISTS(fn) = TRUE Then
MsgBox(0, fn & "file exists")

n = FILE_KILL (fn)

If n = 0 Then
MsgBox(0, fn & "file is gone")
Else
MsgBox(0, " " & n & " error ")
EndIf
EndIf

the error returned is 70

thank you

Charly Jungbauer

Petr Schreiber
09-11-2009, 14:55
Welcome to the forums!

The Error 70 is "Permission Denied", that means some process might still use it, or file is open ... such a things.


Petr

P.S. I just realised the explanation of error codes is not present in the help file. I will prepare it and with help of Eros this list will be present in next version of help file.

EDIT: Here is the list of related errors:

53 = File not found
70 = Permission denied
75 = Wrong path
76 = Path not found

Michael Clease
09-11-2009, 15:00
quote"Powerbasic"
Error 70 - Permission denied

Permission denied - (%ERR_PERMISSIONDENIED) - You tried to write to a write-protected disk. This error can also be generated as a result of network permission errors, such as accessing a locked file, or a locked record. It can also occur when attempting to open a subdirectory as a file.


If FILE_EXISTS(fn) = %TRUE Then