Deletes file(s) by name and attribute


      FileDelete(<cFileMask>, [<nFileAttr>]) --> <lDeleted>


<cFileMask> : Designates the file or files to delete.

<nFileAttr> : Designates one of the following file attributes. The default value is 32.

          File Attribute Coding
          Value     Symb. constants   Definition
          0         FA_NORMAL
          1         FA_READONLY       Read-only
          2         FA_HIDDEN         HIDDEN (Concealed files)
          4         FA_SYSTEM         SYSTEM (System files)
          8         FA_VOLUME         VOLUME (Name of floppy/hard disk)
          32        FA_ARCHIVE        ARCHIVE (Changed since last backup)
          63        Everything


<lDeleted> .T. when at least one or more files are deleted; otherwise, .F. is returned.


ERASE command and FErase() function doesn’t support “wildcard” ( “*” / “?” ) characters in file specification. FileDelete() function of tools library does. Occasionally, you will need to clean up a floppy or a hard disk or delete whole file groups. This function deletes entire file groups with a function call, without using the RUN command.


Warning! FileDelete() can also can delete system files.

. The default standard attribute is archive (32). Drive and path designations, and wildcards are permitted.

. Subdirectories must be deleted with the help of the DirRemove() function.


      Attempt to delete all index files, then display the completion status:

      IF FileDelete("*.NDX")
         ? "Files deleted."
         ? "No files found."



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.