Difference between revisions of "$exists"
From Scriptwiki
m ($exists + $isfile + $isdir) |
m (separate page) |
||
Line 1: | Line 1: | ||
− | + | Returns informations on whether or not a file or directory exists. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$exists($mircdir $+ mirc.ini) // returns $true (is a file) | $exists($mircdir $+ mirc.ini) // returns $true (is a file) | ||
$exists($mircdir) // returns $true (is a directory) | $exists($mircdir) // returns $true (is a directory) | ||
Line 12: | Line 6: | ||
== Examples == | == Examples == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
alias file_dir_exists { | alias file_dir_exists { | ||
if ($exists($1)) { return file/directory exists! } | if ($exists($1)) { return file/directory exists! } | ||
else { return file/directory doesn't exist } | else { return file/directory doesn't exist } | ||
} | } | ||
+ | |||
+ | == See Also == | ||
+ | * [[$isfile]] Check if a file exists.<br /> | ||
+ | * [[$isdir]] Check if a directory exists.<br /> | ||
[[Category:File and Directory Identifiers]] | [[Category:File and Directory Identifiers]] |
Latest revision as of 09:49, 18 May 2007
Returns informations on whether or not a file or directory exists.
$exists($mircdir $+ mirc.ini) // returns $true (is a file) $exists($mircdir) // returns $true (is a directory)
Examples
alias file_dir_exists { if ($exists($1)) { return file/directory exists! } else { return file/directory doesn't exist } }