FSO_DeleteByAge

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > File > FSO: functions working on multiple files >

FSO_DeleteByAge

 

Description

 

Giving a path and a file mask, this function delete all files whose age in days is more than given age.

 

Syntax

 

n = FSO_DeleteByAge(FilePath, FileMask, nDays [, PutIntoTrash])

 

Returns

 

Number: number of files deleted.

 

Parameters

 

Name

Type

Optional

Meaning

FilePath

String

No

Directory path to search for

FileMask

String

No

File mask to search for. Wildcards * and ? are accepted

Examples:

"*.temp"

"*.log"

"he??.*"

"*data"

"*.*"

nDays

Numeric

No

Age in days.

PutIntoTrash

Numeric

Yes

If present, %TRUE value will instruct function to move deleted file into trash bin instead of physical remove the file.

 

Remarks

 

Function perform the following steps:

1.search inside FilePath for FileMask files

2.compute the age of the files found

3.if age of the file in days is greater than nDays parameter, file is deleted

 

Restrictions

 

ATTENTION:this function delete files!

 

See also

 

File Module,

 

Examples