Problem with determining wether a file exists or not

I have wasted many hours searching for a way to dertermine wether a file exists or not. Finaly I found the funtion STAT(), I assume new in Asterisk 1.4

Set(FILE_EXISTS=${STAT(e,${PAD})}) is doing the trick. It returns 1 whn the file is there and 0 when it isn’t. There are more usefull parameters and, I found out, a lot more very usefull new functions.

-= Info about function ‘STAT’ =-

[Syntax]
STAT(,)

[Synopsis]
Does a check on the specified file

[Description]
flag may be one of the following:
d - Checks if the file is a directory
e - Checks if the file exists
f - Checks if the file is a regular file
m - Returns the file mode (in octal)
s - Returns the size (in bytes) of the file
A - Returns the epoch at which the file was last accessed
C - Returns the epoch at which the inode was last changed
M - Returns the epoch at which the file was last modified

Nice finding. This is not in 1.2.

In 1.2, you can use a simple AGI to do the same.