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

File exists

From FenixWiki

Revision as of 01:37, 30 April 2007 by Sandman (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search


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