FileOps.$deletefile()

Function group Execute on client Platform(s)
FileOps NO All

Syntax

FileOps.$deletefile(cPath)

Description

Deletes the file or folder named cPath. Pathnames can be over 255 characters, which was the limit in Studio 8.0.1 or earlier.

Files deleted with $deletefile() are not moved into the Recycled bin or Trash can, they are deleted irreversibly. You can delete a folder with $deletefile(), but only if it is empty. The function returns an error code, or zero if successful: see the FileOps function error codes.

Example

Do FileOps.$deletefile('c:\omnis\examples\extcomp\test1.txt') Returns lError
; deletes 'test1.txt' from 'c:\omnis\examples\extcomp'

Do FileOps.$changeworkingdir('c:\omnis') Returns lError
Do FileOps.$deletefile('test2.txt') Returns lError
; deletes 'test2.txt' at the current folder 'c:\omnis'

Do FileOps.$deletefile('c:\omnis\examples\extcomp\clock') Returns lError
; deletes the 'clock' folder if empty