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

Fgets

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 12:35, 26 June 2007 (edit)
Sandman (Talk | contribs)

← Previous diff
Current revision (13:55, 26 June 2007) (edit) (undo)
Sandman (Talk | contribs)
m
 
(2 intermediate revisions not shown.)
Line 3: Line 3:
==Definition== ==Definition==
-'''STRING''' file ( <'''STRING''' filename> )+'''STRING''' fgets ( <'''INT''' filehandle> )
-Returns the whole contents of a certain file.+Reads a line from a certain file and returns it. Subsequent calls will return the next line, until the end of the file is reached.
== Parameters == == Parameters ==
{| {|
-| '''STRING''' filename || - The filename of the file you wish to read from (including extension and possible path).+| '''INT''' filehandle || - The [[FileHandle]] of the file returned by [[fopen]]().
|} |}
== Returns == == Returns ==
-'''STRING''': The contents of the file.+'''STRING''': The line read.
 + 
 +== Notes ==
 +The returned string normally does not contain the '\n' or '\r','\n' charactersets.
 + 
 +When a line ends with the character '\', the next line will be joined with the current one, changing the '\' character to a '\n' character.

Current revision


Contents

[edit] Definition

STRING fgets ( <INT filehandle> )

Reads a line from a certain file and returns it. Subsequent calls will return the next line, until the end of the file is reached.

[edit] Parameters

INT filehandle - The FileHandle of the file returned by fopen().

[edit] Returns

STRING: The line read.

[edit] Notes

The returned string normally does not contain the '\n' or '\r','\n' charactersets.

When a line ends with the character '\', the next line will be joined with the current one, changing the '\' character to a '\n' character.

Personal tools