This wiki is out of date, use the continuation of this wiki instead

File exists

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:21, 22 April 2007 (edit)
Woody (Talk | contribs)

← Previous diff
Current revision (01:37, 30 April 2007) (edit) (undo)
Sandman (Talk | contribs)

 
Line 2: Line 2:
[[Category:files]] [[Category:files]]
 +== Definition ==
'''INT''' file_exists ( <'''STRING''' filename> ) '''INT''' file_exists ( <'''STRING''' filename> )
-Give it a filename and it'll tell you if it exists. Don't make me write an example.+Checks if a certain file exists.
 + 
 +== Parameters ==
 +{|
 +| '''STRING''' filename || - The file to be checked for existence, including a possible path.
 +|}
 + 
 +== Returns ==
 +'''INT''' : The existence of the file.
 +{|
 +| [[true]] || - The specified file exists.
 +|-
 +| [[false]] || - The specified file doesn't exist.
 +|}
 + 
 +== Example ==
 +<pre>
 +Program existence;
 +Begin
 + 
 + say("> C:\Windows\notepad.exe > " + file_exists("C:\Windows\notepad.exe")); // A filename with
 + // absolute path
 + say("> SDL.dll > " + file_exists("SDL.dll")); // A filename without a path
 + say("> SomeNonExistingFile > " + file_exists("SomeNonExistingFile")); // A nonexisting file
 + 
 + Repeat
 + frame;
 + Until(key(_esc))
 + 
 +End
 +</pre>
 +Used in example: [[say]]()

Current revision


Contents

[edit] Definition

INT file_exists ( <STRING filename> )

Checks if a certain file exists.

[edit] Parameters

STRING filename - The file to be checked for existence, including a possible path.

[edit] Returns

INT : The existence of the file.

true - The specified file exists.
false - The specified file doesn't exist.

[edit] Example

Program existence;
Begin

    say("> C:\Windows\notepad.exe > " + file_exists("C:\Windows\notepad.exe")); // A filename with
                                                                                // absolute path
    say("> SDL.dll > " + file_exists("SDL.dll")); // A filename without a path
    say("> SomeNonExistingFile > " + file_exists("SomeNonExistingFile")); // A nonexisting file

    Repeat
        frame;
    Until(key(_esc))

End

Used in example: say()

Personal tools