| [Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | 
Delete a file from the filesystem.
Source position: filutilh.inc line 135
| function DeleteFile( | 
| const FileName: UnicodeString | 
| ):Boolean; | 
| const FileName: RawByteString | 
| ):Boolean; | 
DeleteFile deletes file FileName from disk. The function returns True if the file was successfully removed, False otherwise.
On error, False is returned.
| 
 | Create a new file and return a handle to it. | |
| 
 | Check whether a particular file exists in the filesystem. | 
Program Example31; { This program demonstrates the DeleteFile function } Uses sysutils; Var Line : String; F,I : Longint; Begin F:=FileCreate('test.txt'); Line:='Some string line.'#10; For I:=1 to 10 do FileWrite (F,Line[1],Length(Line)); FileClose(F); DeleteFile('test.txt'); End.