Lua
C++
Edit

DeleteFile

This function deletes a file.

Syntax

Parameter Description
path file path to delete

Returns

Returns true if the file was successfully deleted.

Example

path = GetPath(PATH_DOCUMENTS) .. "/temp.bin"

CreateFile(path)
if FileType(path) ~= 1 then
    print("Failed to write file.")
    return
end

print("File created.")

OpenDir(path)
Sleep(3000)

if DeleteFile(path) then
    print("File deleted.")
else
    print("Failed to delete file.")
end
Copyright © 2024 Ultra Software.
All rights reserved.