BE_FileReadText

BE_FileReadText ( pathOrContainer {; start; to; eolChar } )

Reads the contents of the file at pathOrContainer as text and returns the content.  The file can be text, in which case it's interpreted as a path, and the plugin looks for the file at the path, or binary ( container ) in which case it treats it as a text file and tries to read the content.

Version : 1.0
4.0 : Allow reading text from a container file instead of a path.
4.0.2 : Renamed from BE_ReadTextFromFile
4.2.0 : added start, to and eolChar parameters.

Parameters :
path : a system file path.
start : when looking within a sub section of the file, this is the position to begin reading.
to : when looking within a sub section of the file, this is the position to stop reading.
eolChar : when this is supplied, the function reads lines instead of characters.  So the from to reference the line count, not the character count.

Result : content of the file if it exists, ? for an invalid path or a system level error code for a failure to read the file.

Examples

BE_FileReadText ( $path ) // reads the entire file
BE_FileReadText ( $path ; 0 ; 99 )  //reads the first 100 characters
BE_FileReadText ( $path ; 0 ; 10 ; char ( 10 ) )  //reads the first 10 lines of the file.
BE_FileReadText ( $path ; 10 ;  ; char ( 10 ) )   // reads from line 10 to the end of the file.
BE_FileReadText ( $path ;   ; 10 ; char ( 10 ) )  // reads the last 10 lines of the file.

Still need help? Contact Us Contact Us