Difference between revisions of "$isdir"

From Scriptwiki
Jump to: navigation, search
m (page spacing)
m (separate page)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Returns informations on whether or not a directory exists.
 
Returns informations on whether or not a directory exists.
  
$isdir(directory)
+
$isdir($mircdir $+ mirc.ini)  // returns $false (is a file)
 
+
$isdir($mircdir)              // returns $true (is a directory)
Returns $true if the directory exists, otherwise it will return $false
 
  
 
== Examples ==
 
== Examples ==
  
  alias exists? {
+
  alias dir_exists {
  if ($isdir($1)) { return directory exists! } | else { return directory doesn't exist }
+
  if ($isdir($1)) { return directory exists! }  
 +
  else { return directory doesn't exist }
 
  }
 
  }
  
$isdir(C:\program files\mirc)
+
== See Also ==
 
+
* [[$isfile]] Check if a file exists.<br />
== See also ==
+
* [[$exists]] Check if a file OR directory exists.<br />
 
 
[[$isfile]] to check if a file exists.
 
 
 
  
 
[[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 directory exists.

$isdir($mircdir $+ mirc.ini)  // returns $false (is a file)
$isdir($mircdir)              // returns $true (is a directory)

Examples

alias dir_exists {
  if ($isdir($1)) { return directory exists! } 
  else { return directory doesn't exist }
}

See Also

  • $isfile Check if a file exists.
  • $exists Check if a file OR directory exists.