Go to: Return value. Related commands. Examples.
// Make a sample file to use as a test example // $exampleFileName = ( `internalVar -userTmpDir` + "example.tmp" ); $fileId=`fopen $exampleFileName "w"`; fprint $fileId "Hello there\nuser"; fclose $fileId; // // Now read it back one word at a time, checking for the end of the file // $fileId=`fopen $exampleFileName "r"`; while ( !`feof $fileId` ) { string $nextWord = `fgetword $fileId`; if ( size( $nextWord ) > 0 ) { print ( $nextWord + "\n" ); } } fclose $fileId;