Delete a file from an Lazarus/FPC app lazarus / 21-General ---------------------------------------------------------------------- 1HuntnMan · 2023-11-18 15:24 Simple question but can't find in any of my docs on Lazarus on how to delete a file.  I'm programming on a Windows computer and want to export the data from a database (TDbf) table, delete the table and it's index/memo files, then recreate the table and indexes then import the CSV export data. I know how to do all that except delete the files with pascal code. ---------------------------------------------------------------------- jamie · 2023-11-18 15:27 deleteFile ? Just specify the full path to it and make sure the file isn't in use at the time. ---------------------------------------------------------------------- cpicanco · 2023-11-18 15:39 Take a look at DeleteFile: https://www.freepascal.org/docs- html/rtl/sysutils/deletefile.html ---------------------------------------------------------------------- 1HuntnMan · 2023-11-18 19:55 Thanks, Delete a file from the file system. function DeleteFile(const FileName: RawByteString):Boolean; Description: DeleteFile deletes file FileName from disk. The function returns True if the file was successfully removed, False otherwise.  On error, False is returned. So, to delete a Dbf file named Appointments.dbf from a file located on 'C:\Documents\Software Development\PMS Project\PMS Data\' if DeleteFile(C:\Documents\Software Development\PMS Data\Appointments.dbf) = True then   CreateNewAppointments.dbf table code else   Error statement; Correct? ---------------------------------------------------------------------- 1HuntnMan · 2023-11-18 20:06 DeleteFile('C:\Documents\Software Development\PMS Project\PMS Data\Appointments.dbf'); More correct ... Thanks