Results 1 to 3 of 3

Thread: File_kill

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    1
    Rep Power
    0

    File_kill

    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

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: File_kill

    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
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    Re: File_kill

    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
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •