xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

FileReader()

Returns a new TStreamFileReader object.

Syntax

FileReader( <cFileName>, [<nMode>] ) --> oTStreamFileReader

Arguments

<cFileName>
This is a character string holding the name of the file to open for reading. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory.
<nMode>
A numeric value specifying the open mode and access rights for the file. #define constants from the FILEIO.CH file can be used for <nMode> as listed in the table below:

File open modes
ConstantValueDescription
FO_READ0Open file for reading
FO_WRITE1Open file for writing
FO_READWRITE *)2Open file for reading and writing

Constants that define the access or file sharing rights can be added to an FO_* constant. They specify how file access is granted to other applications in a network environment.

File sharing modes
ConstantValueDescription
FO_COMPAT *)0Compatibility mode
FO_EXCLUSIVE16Exclusive use
FO_DENYWRITE32Prevent other applications from writing
FO_DENYREAD48Prevent other applications from reading
FO_DENYNONE64Allow others to read or write
FO_SHARED64Same as FO_DENYNONE

Return

The function returns a new, initialized TStreamFileReader object.

Description

Function TStreamFileReader() is the functional equivalent of TStreamFileReader():new(). Refer to the description of the TStreamFileReader object.

Info

See also:TStreamFileReader()
Category: Object functions , xHarbour extensions
Header:fileio.ch
Source:rtl\stream.prg
LIB:lib\xhb.lib
DLL:dll\xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe