removefiles


Purpose
Remove files selected using file name patterns.
Synopsis
procedure removefiles(opt:integer, dir:text,filters:text)
procedure removefiles(filters:text)
Arguments
opt 
Options (several options can be combined):
SYS_RECURS 
Recursive search in subdirectories
SYS_NODIR 
Do not remove directories (only files)
SYS_DIRONLY 
Remove only directories
dir 
Base directory for the search (default: current directory)
filters 
File name filters (default: all files removed)
Example
The following deletes directory "mydir" including its content:
removefiles(SYS_RECURS,"mydir","*")
removedir("mydir")
Further information
1. The filters argument consists in a list of patterns separated by the symbol ";". A pattern is composed of a path (using the usual operating system conventions) which last component may include wildcard characters "*" (any text of any length), "?" (any single character) and "|" (logical "or"). For instance "bin/*.exe;models/*.mos|*.dat" will select all files with extension ".exe" in the "bin" directory as well as files with extension ".mos" and ".dat" in the "models" directory.
2. File name matching is achieved using function pathmatch and differences may be observed depending on the operating system (e.g. file names are case sensitive under Posix systems but not under Windows).
Related topics
findfiles, fdelete, removedir
Module
mmsystem


If you have any comments or suggestions about these pages, please send mail to support@fico.com.

© Copyright 2001-2013 Fair Isaac Corporation. All rights reserved.