xHarbour Reference Documentation > Function Reference |
Reads an entire file from disk into memory.
MemoRead( <cFileName> ) --> cString
The function returns the entire contents of file <cFileName> as a character string. If the file is not found, an empty string ("") is returned.
MemoRead() provides the fastest way of reading the entire contents of a file from disk and assign it to a memory or field variable. The function searches a file only in the current directory, if <cFileName> is not a full qualified file name. The settings of SET PATH and SET DEFAULT are ignored.
The file is opened as read-only and in shared mode. If this fails due to another process having obtained exclusive access to the file, or if the file is not found, the return value is an empty string ("").
See also: | MemoEdit(), MemoLine(), MemoWrit(), REPLACE |
Category: | Character functions , Memo functions |
Source: | rtl\memofile.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// See the examples of function MemoEdit() or MemoLine() for // a usage scenario of MemoRead()
http://www.xHarbour.com