nFiles ADIR([<cFilespec>],[<aFilenames>],[<aSizes>],[<aDates>], [<aTimes>],[<aAttributes>]) lRet bZip2Close(<nHandle>) nHandle bZip2Open(<filename> [,<mode>]) realLen bZip2Read(<nHandle>, <@cBuffer> [,<nLen>]) realLen bZip2Write(<nHandle>, <cBuffer> [,<nLen>]) cDirectory CURDIR([<cDrivespec>]) nSuccess DIRCHANGE(<cDir>) aDirectory DIRECTORY(<cDirSpec>, [<cAttributes>]) nOsCode DOSERROR([<nNewOsCode>]) <sDosFileName> DOSPATH(<sUnixFileName>) TRUE || FALSE FACCESS(<sFileName>, <sMode>) lError FCLOSE(<nHandle>) nHandle FCREATE(<cFile>, [<nAttribute>]) nSuccess FERASE(<cFile>) nErrorCode FERROR() lExists FILE(<cFilespec>) <sFileAttrs> FILEATTRS(<sFileName>) <sFileStr> FILEGETSTR(<nFileHandle>, <nSize>) nHandle FOPEN(<cFile>, [<nMode>]) nBytes FREAD(<nHandle>, @<cBufferVar>, <nBytes>) cString FREADSTR(<nHandle>, <nBytes>) nSuccess FRENAME(<cOldFile>, <cNewFile>) nPosition FSEEK(<nHandle>, <nOffset>, [<nOrigin>]) NIL FT_DFCLOSE() nResult FT_DFSETUP( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ; <nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>, ; <lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) NIL FT_FAPPEND( [ < nLines > ] ) lResult FT_FBOF() lSuccess FT_FDELETE( [ < nLines > ] ) lResult FT_FEOF() nErrorNo FT_FERROR() NIL FT_FGOBOT() NIL FT_FGOTO( nLine ) NIL FT_FGOTOP() lSuccess FT_FINSERT( [ < nLines > ] ) nLastRecordNum FT_FLASTRE() cLine FT_FREADLN() nRecNo FT_FRECNO() nPreviousArea FT_FSELECT( [ <nNewArea> ] ) nLinesSkipped FT_FSKIP( [ <nLines> ] ) nHandle | 0 FT_FUSE( [ <cFile> ] [, <nMode> ] ) lSuccess FT_FWRITELN( < cData >, [ < lInsert > ] ) nBytesWritten FWRITE(<nHandle>, <cBuffer>, [<nBytes>]) lRet gZipClose(<nHandle>) nHandle gZipOpen(<filename> [,<mode>]) realLen gZipRead(<nHandle>, <@cBuffer> [,<nLen>]) realLen gZipWrite(<nHandle>, <cBuffer> [,<nLen>]) <sUnixPath> MAKEPATH(<sDosPath>) cString MEMOREAD(<cFile>) lSuccess MEMOWRIT(<cFile>, <cString>) lError NETERR([<lNewError>]) NIL OUTERR(<exp list>) NIL OUTSTD(<exp list>) <sPath> STARTPATH() <nNewSocket> TCPACCEPT(<nSock>[, <nTimeout>]) TRUE || FALSE TCPCLOSE(<nConnection>) <nConnection> TCPCONNECT(<sHostName>[, <nPort>][, <nTimeout>]) <nErrNo> TCPLISTEN(<nPort>[, <nBackLog>]) <nLenBuf> TCPREAD(<nConnection>, @<sBuffer>, <nLen>[, <nTimeout>]) <nLenBuf> TCPWRITE(<nConnection>, <sBuffer>, <nLen>[, <nTimeout>])
FACCESS(<sFileName>, <sMode>) --> TRUE || FALSE
FACCESS() checks access mode <sMode> for file <sFileName>.
<sMode> is the string in UNIX format "rwx-rwx-rwx" (owner-group-other)
FCLOSE(<nHandle>) --> lError
FCLOSE() is a low-level file function that closes binary files and forces the associated DOS buffers to be written to disk. If the operation fails, FCLOSE() returns false (.F.). FERROR() can then be used to determine the reason for the failure. For example, attempting to use FCLOSE() with an invalid handle returns false (.F.), and FERROR() returns DOS error 6, invalid handle. See FERROR() for a complete list of error numbers.
Warning! This function allows low-level access to DOS files and devices. It should be used with extreme care and requires a thorough knowledge of the operating system.
FCREATE(<cFile>, [<nAttribute>]) --> nHandle
FCREATE() is a low-level file function that either creates a new file or opens and truncates an existing file. If <cFile> does not exist, it is created and opened for writing. If it does exist and can be opened for writing, it is truncated to zero-length. If it cannot be opened for writing, FCREATE() returns -1 and FERROR() returns the appropriate error value.
When FCREATE() successfully creates a new file, the file is left open in compatibility sharing mode and read/write access mode. The file attribute specified by the <nAttribute> argument is applied to the new file when it is closed, allowing writing to a newly created read-only file. For a list of access modes, see FOPEN().
Since a file handle is required in order to identify an open file to other file functions, always assign the return value from FCREATE() to a variable for later use.
Like other file functions, FCREATE() does not use either the DEFAULT or PATH settings for its operation. Instead, it writes to the current DOS directory unless a path is explicitly stated.
Warning! This function allows low-level access to DOS files and devices. It should be used with extreme care and requires a thorough knowledge of the operating system.
<cFile> | is the name of the file to create. If the file already exists, its length is truncated to zero without warning. |
<nAttribute> | is one of the binary file attributes shown in the table below. If this argument is omitted, the default value is zero. Binary File Attributes ------------------------------------------------------------------------ Value Fileio.ch Attribute Description ------------------------------------------------------------------------ 0 FC_NORMAL Normal Create normal read/write file (default) 1 FC_READONLY Read-only Create read-only file 2 FC_HIDDEN Hidden Create hidden file 4 FC_SYSTEM System Create system file ------------------------------------------------------------------------ |
Returns : | FCREATE() returns the DOS file handle number of the new binary file in the range of zero to 65,535. If an error occurs, FCREATE() returns -1 and FERROR() is set to indicate an error code. |
See also : | FCLOSE() FERROR() FOPEN() |
FERASE(<cFile>) --> nSuccess
FERASE() is a file function that deletes a specified file from disk. FERASE() is the same as the ERASE command but returns a value and can be specified within an expression. When FERASE() is called, <cFile> is deleted from disk only if found in the current DOS directory or in the directory explicitly specified as part of the file name. Like the other file functions and commands, FERASE() does not use either SET DEFAULT or SET PATH to locate <cFile>.
Warning! Files must be CLOSEd before removing them with FERASE().
<cFile> | is the name of the file to be deleted from disk, including extension, optionally preceded by a drive and/or path specification. |
Returns : | FERASE() returns -1 if the operation fails and zero if it succeeds. In the case of a failure, FERROR() can be used to determine the nature of the error. |
See also : | FERROR() FRENAME() |
FILE(<cFilespec>) --> lExists
FILE() is an environment function that determines whether any file matching a file specification pattern is found. FILE() searches the specified directory if a path is explicitly specified.
If a path is not specified, FILE() searches the current xClipper default directory and then the xClipper path. In no case is the DOS path searched. Note also that FILE() does not recognize hidden or system files in its search.
<cFilespec> | is in the current xClipper default directory and path. It is a standard file specification that can include the wildcard characters * and ? as well as a drive and path reference. Explicit references to a file must also include an extension. |
Returns : | FILE() returns true (.T.) if there is a match for any file matching the <cFilespec> pattern; otherwise, it returns false (.F.). |
FILEATTRS(<sFileName>) --> <sFileAttrs>
FILEATTRS() lakes FILEATTR(), but returns string <sFileAttrs>, what contents file attributes.
<sFileName> | String, is the file name. |
Returns : | Returns string <sFileAttrs>, what contents file attributes. |
See also : | FILEATTR() |
FILEGETSTR(<nFileHandle>, <nSize>) --> <sFileStr>
FILEGETSTR() reads string from opened file. The size result string restrict <CRLF> or <CR>, but no more then <nSize> symbols.
<nFileHandle> | Numeric, is the file handler. |
<nSize> | Numeric, is the size string. |
Returns : | Returns string <sFileStr>, what was read from file <nFileHandle>. |
See also : | FOPEN() |
FOPEN(<cFile>, [<nMode>]) --> nHandle
FOPEN() is a low-level file function that opens an existing binary file for reading and writing, depending on the <nMode> argument. Whenever there is an open error, use FERROR() to return the DOS error number. For example, if the file does not exist, FOPEN() returns -1 and FERROR() returns 2 to indicate that the file was not found. See FERROR() for a complete list of error numbers.
If the specified file is opened successfully, the value returned is the DOS handle for the file. This value is similar to an alias in the database system and is required to identify the open file to other file functions. It is, therefore, important to assign the return value to a variable for later use as in the example below.
Warning! This function allows low-level access to DOS files and devices. It should be used with extreme care and requires a thorough knowledge of the operating system.
<cFile> | is the name of the file to open, including the path if there is one. |
<nMode> | is the requested DOS open mode indicating how the opened file is to be accessed. The open mode is composed of elements from the two types of modes described in the tables below. If just the Access Mode is used, the file is opened non-sharable. The default open mode is zero, which indicates non-sharable and read-only. FOPEN() Access Modes ------------------------------------------------------------------------ Mode Fileio.ch Operation ------------------------------------------------------------------------ 0 FO_READ Open for reading (default) 1 FO_WRITE Open for writing 2 FO_READWRITE Open for reading or writing ------------------------------------------------------------------------The Sharing Modes determine how other processes may access the file. FOPEN() Sharing Modes ------------------------------------------------------------------------ Mode Fileio.ch Operation ------------------------------------------------------------------------ 0 FO_COMPAT Compatibility mode (default) 16 FO_EXCLUSIVE Exclusive use 32 FO_DENYWRITE Prevent others from writing 48 FO_DENYREAD Prevent others from reading 64 FO_DENYNONE Allow others to read or write 64 FO_SHARED Same as FO_DENYNONE ------------------------------------------------------------------------The Access Modes in combination (+) with the Sharing modes determine the accessibility of the file in a network environment. |
Returns : | FOPEN() returns the file handle of the opened file in the range of zero to 65,535. If an error occurs, FOPEN() returns -1. |
See also : | FCLOSE() FCREATE() FERROR() |
FREAD(<nHandle>, @<cBufferVar>, <nBytes>) --> nBytes
FREAD() is a low-level file function that reads characters from a binary file into an existing character variable. It reads from the file starting at the current DOS file pointer position, advancing the file pointer by the number of bytes read. All characters are read including control, null, and high-order (above CHR(127)) characters.
FREAD() is similar in some respects to both FREADSTR() and FSEEK(). FREADSTR() reads a specified number of bytes from a file up to the next null (CHR(0)) character. FSEEK() moves the file pointer without reading.
If there is an error during the file read, FERROR() returns the DOS error number. See FERROR() for the list of error numbers.
Warning! This function allows low-level access to DOS files and devices. It should be used with extreme care and requires a thorough knowledge of the operating system.
<nHandle> | is the file handle obtained from FOPEN(), FCREATE(), or predefined by DOS. |
<cBufferVar> | is the name of an existing and initialized character variable used to store data read from the specified file. The length of this variable must be greater than or equal to <nBytes>. <cBufferVar> must be passed by reference and, therefore, must be prefaced by the pass- by-reference operator (@). |
<nBytes> | is the number of bytes to read into the buffer. |
Returns : | FREAD() returns the number of bytes successfully read as an integer numeric value. A return value less than <nBytes> or zero indicates end of file or some other read error. |
See also : | BIN2I() BIN2L() BIN2W() FCLOSE() FCREATE() FERROR() FWRITE() |
FREADSTR(<nHandle>, <nBytes>) --> cString
FREADSTR() is a low-level file function that reads characters from an open binary file beginning with the current DOS file pointer position. Characters are read up to <nBytes> or until a null character (CHR(0)) is encountered. All characters are read including control characters except for CHR(0). The file pointer is then moved forward <nBytes>. If <nBytes> is greater than the number of bytes from the pointer position to the end of the file, the file pointer is positioned to the last byte in the file.
Warning! This function allows low-level access to DOS files and devices. It should be used with extreme care and requires a thorough knowledge of the operating system.
<nHandle> | is the file handle obtained from FOPEN(), FCREATE(), or predefined by DOS. |
<nBytes> | is the number of bytes to read, beginning at the current DOS file pointer position. |
Returns : | FREADSTR() returns a character string up to 65,535 (64K) bytes. A null return value ("") indicates an error or end of file. |
See also : | BIN2I() BIN2L() BIN2W() FERROR() FOPEN() FREAD() FSEEK() |
FRENAME(<cOldFile>, <cNewFile>) --> nSuccess
FRENAME() is a file function that changes the name of a specified file to a new name and is identical to the RENAME command.
When FRENAME() is called, <cOldFile> is renamed only if it is located in the current DOS directory or in the specified path. FRENAME() does not use SET DEFAULT or SET PATH to locate <cOldFile>.
If the source directory is different from the target directory, the file moves to the target directory. In the instance that either <cNewFile> exists or is currently open, FRENAME() fails and returns -1, indicating that it did not perform its designated action. The nature of the error can be determined with FERROR().
Warning! Files must be CLOSEd before renaming. Attempting to rename an open file will produce unpredictable results. When a database file is renamed, the associated memo (.dbt) file must also be renamed. Failure to do so may compromise the integrity of your databases.
<cOldFile> | is the name of the file to be renamed, including the file extension. A drive letter and/or path name may also be included as part of the file name. |
<cNewFile> | is the new name of the file, including the file extension. A drive letter and/or path name may also be included as part of the name. |
Returns : | FRENAME() returns -1 if the operation fails and zero if it succeeds. In the case of a failure, FERROR() can be used to determine the nature of the error. |
See also : | FERASE() FERROR() FILE() |
FSEEK(<nHandle>, <nOffset>, [<nOrigin>]) --> nPosition
FSEEK() is a low-level file function that moves the file pointer forward or backward in an open binary file without actually reading the contents of the specified file. The beginning position and offset are specified as function arguments, and the new file position is returned. Regardless of the function arguments specified, the file pointer cannot be moved beyond the beginning or end of file boundaries.
Warning! This function allows low-level access to DOS files and devices. It should be used with extreme care and requires a thorough knowledge of the operating system.
<nHandle> | is the file handle obtained from FOPEN(), FCREATE(), or predefined by DOS. |
<nOffset> | is the number of bytes to move the file pointer from the position defined by <nOrigin>. It can be a positive or negative number. A positive number moves the pointer forward, and a negative number moves the pointer backward in the file. |
<nOrigin> | defines the starting location of the file pointer before FSEEK() is executed. The default value is zero, representing the beginning of file. If <nOrigin> is the end of file, <nOffset> must be zero or negative. Methods of Moving the File Pointer ------------------------------------------------------------------------ Origin Fileio.ch Description ------------------------------------------------------------------------ 0 FS_SET Seek from beginning of file 1 FS_RELATIVE Seek from the current pointer position 2 FS_END Seek from end of file ------------------------------------------------------------------------ |
Returns : | FSEEK() returns the new position of the file pointer relative to the beginning of file (position 0) as an integer numeric value. This value is without regard to the original position of the file pointer. |
See also : | FCLOSE() FCREATE() FERROR() FOPEN() FREAD() FREADSTR() FWRITE() |
FT_DFCLOSE() --> NIL
Closes the file opened by FT_DFSETUP()
Returns : | NIL |
See also : | FT_DFSETUP() FT_DISPFILE() |
FT_DFSETUP( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ; <nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>, ; <lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) --> nResult
Note: make sure you allocate a buffer large enough to hold enough data for the number of lines that you have in the window. Use the following formula as a guideline:
buffer size = (# of line) + 1 * RMargin
This is the smallest you should make the buffer. For normal use, 4096 bytes is recommended
<cInFile> | - text file to display (full path and filename) |
<nTop> | - upper row of window |
<nLeft> | - left col of window |
<nBottom> | - lower row of window |
<nRight> | - right col of window |
<nStart> | - line to place highlight at startup |
<nCNormal> | - normal text color (numeric attribute) |
<nCHighlight> | - text highlight color (numeric attribute) |
<cExitKeys> | - terminating key list (each byte of string is a key code) |
<lBrowse> | - act-like-a-browse-routine flag |
<nColSkip> | - col increment for left/right arrows |
<nRMargin> | - right margin - anything to right is truncated |
<nBuffSize> | - size of the paging buffer |
Returns : | 0 if successful, FError() code if not |
See also : | FT_DISPFILE() FT_DFCLOSE() |
FT_FAPPEND( [ < nLines > ] ) --> NIL
This function appends a line of text to the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. The record pointer is moved to the last appended record.
Multiple lines may be appended with one call to FT_FAPPEND().
A text file "record" is a line of text terminated by a CRLF pair. Each line appended with this function will be empty.
NOTE: Occasionally a text file may contain a non-CRLF terminated line, at the end of the file ("stragglers"). This function assumes these stragglers to be the last line of the file, and begins appending the new lines after this line. In other words, if the last line in the text file is not terminated with a CRLF pair prior to calling FT_FAPPEND(), the function will terminate that last line before appending any new lines.
<nLines> | is the number of lines that should be appended to the end of the currently selected text file. If <nLines> is omitted, one record is appended. |
Returns : | lSuccess. If FALSE, check ^bft_fError()^n for the error code. |
See also : | FT_FRECNO() FT_FDELETE() FT_FINSERT() FT_FLASTRE() |
FT_FBOF() --> lResult
This function is similar to the CLIPPER Bof() function.
A text file "record" is a line of text terminated by a CRLF pair.
Returns : | .T. if an attempt was made to skip past the first record of the currently selected text file, otherwise .F. |
See also : | FT_FSKIP() FT_FEOF() FT_FGOTOP() |
FT_FDELETE( [ < nLines > ] ) --> lSuccess
This function deletes one or several lines of text from the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. The record pointer is not moved, unless the deleted lines occur at the end of the file, in which case ^bft_fRecno()^n will equal ^bft_fLastRe()^n and ^bft_fEOF()^n will be set to TRUE.
Returns : | TRUE if successful, otherwise check ^ft_fError()^n for error code. |
See also : | FT_FAPPEND() FT_FRECNO() FT_FINSERT() |
FT_FEOF() --> lResult
This function is similar to the CLIPPER Eof() function.
A text file "record" is a line of text terminated by a CRLF pair.
Returns : | .T. if an attempt was made to skip past the last record of the currently selected text file, otherwise .F. |
See also : | FT_FUSE() FT_FSKIP() |
FT_FERROR() --> nErrorNo
This function returns the DOS error code associated with a file operation on the currently selected text file.
Errors could stem from any open, create, read or write operation, among others.
FT_FGOBOT() --> NIL
This function moves the record pointer to the last record of the file in the currently selected text file workarea.
If a read error occurs ^ft_fError()^n will contain the error code.
A text file "record" is a line of text terminated by a CRLF pair.
Returns : | NIL |
See also : | FT_FSELECT() FT_FUSE() FT_FGOTOP() FT_FRECNO() FT_FREADLN() |
FT_FGOTO( nLine ) --> NIL
This function moves the record pointer to a specific record in the file in the currently selected text file workarea. If the record number requested is greater than the number of records in the file, the record pointer will be positioned at the last record.
Internally, the function operates differently depending on how you invoke it. Passing a value for ^b<nLine>^n results in what is effectively a skip operation, which is fairly quick. However if you pass 0 for ^b<nLine>^n, e.g. ft_fGoTo( 0 ), the function internally goes to the top of the file, then skips down the required number of records. Hence if your file is relatively large and the current record is a high number, you may see some delay as ft_fGoTo(0) skips through the file.
A text file "record" is a line of text terminated by a CRLF pair.
<nLine> | is the record number to go to. |
Returns : | NIL |
See also : | FT_FRECNO() FT_FGOTOP() FT_FREADLN() |
FT_FGOTOP() --> NIL
This function moves the record pointer to the first record in the currently selected text file workarea.
A text file "record" is a line of text terminated by a CRLF pair.
Returns : | NIL |
See also : | FT_FSELECT() FT_FUSE() FT_FRECNO() FT_FGOBOT() |
FT_FINSERT( [ < nLines > ] ) --> lSuccess
This function inserts a line of text in the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair.
The record pointer is not moved.
A text file "record" is a line of text terminated by a CRLF pair. Each line inserted with this function will be empty.
Returns : | ^blSuccess^n is TRUE if the insert succeeded, FALSE if not. If false check the return value of ^bft_fError()^n for the reason. |
See also : | FT_FAPPEND() FT_FRECNO() FT_FDELETE() FT_FLASTRE() |
FT_FLASTRE() --> nLastRecordNum
This function returns the number of the last record in a text file.
A text file "record" is a line of text terminated by a CRLF pair.
Returns : | An integer containing the number of records in the text file in the currently selected text file workarea, or zero if no file is currently open in the workarea. |
See also : | FT_FUSE() FT_FRECNO() |
FT_FREADLN() --> cLine
This function returns a line of text read from the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. The record pointer is not moved.
Currently the maximum record size is 4096 characters. You may increase the maximum record size by changing the value of ^b#define ^bBUFFSIZE^n in the C source and recompiling, however you should consider the performance implications if you do (all read and writes use this buffer size, including ft_fSkip()'s and ft_fGoto()'s).
If a read error occurs ^ft_fError()^n will contain the error code.
A text file "record" is a line of text terminated by a CRLF pair.
Returns : | A string containing the current record in a text file. |
See also : | FT_FUSE() FT_FWRITELN() FT_FRECNO() FT_FGOTOP() |
FT_FRECNO() --> nRecNo
This function returns the current record number of the file open in the currently selected text file workarea.
A text file "record" is a line of text terminated by a CRLF pair.
Returns : | The current record number of a text file or 0 if no file is open. |
See also : | FT_FSELECT() FT_FUSE() FT_FGOTOP() FT_FGOBOT() |
FT_FSELECT( [ <nNewArea> ] ) --> nPreviousArea
This function selects a text file "workarea" from 1 to 10. A file may or may not be open in the selected area.
Passing 0 for ^b<nNewArea>^n selects the next available workarea, similar to Clipper's SELECT 0 command. If no more workareas are available the current workarea is not changed.
Each file is opened in its own "workarea", similar to the concept used by dbf files. As provided, a maximum of 10 files (in 10 workareas) can be opened (assuming there are sufficient file handles available). That number may be increased by modifying the #define TEXT_WORKAREAS in the C source code and recompiling.
All the FT_F*() file functions operate on the file in the currently selected text file workarea.
Text file workareas are separate from and independent of Clipper's database workareas.
Returns : | The current selected text file area. |
See also : | FT_FUSE() |
FT_FSKIP( [ <nLines> ] ) --> nLinesSkipped
This function moves the text file record pointer, similar to the CLIPPER SKIP command.
Use the return value to determine how many records were actually skipped, for example to write a custom skipper function for TBrowse'g text files.
If a read error occurs ^ft_fError()^n will contain the error code.
A text file "record" is a line of text terminated by a CRLF pair.
<nLines> | is the number of lines to skip. Defaults to 1 if not specified. |
Returns : | The number of lines actually skipped. If the file's EOF or BOF was encountered before ^b<nLines>^n could be skipped, the return value will be less than ^b<nLines>^n. |
See also : | FT_FRECNO() FT_FGOTOP() |
FT_FUSE( [ <cFile> ] [, <nMode> ] ) --> nHandle | 0
The FT_F*() file functions are for reading text files, that is, files where each line (record) is delimited by a CRLF pair.
Each file is opened in its own "workarea", similar to the concept use by dbf files. As provided, a maximum of 10 files (in 10 workareas) can be opened (assuming there are sufficient file handles available). That number may be increased by modifying the #define TEXT_WORKAREAS in the C source code and recompiling.
Returns : | If ^b<cFile>^n is passed and the file is opened successfully, an integer containing the text file's workarea. If the file cannot be opened, -1 will be returned. In this case, check the return value of ^bft_fError()^n for the cause of the error. If FT_FUSE() is called without any arguments, it will close the text file in the current "text area" and return 0. If a read error occurs ^ft_fError()^n will contain the error code. |
See also : | FT_FUSE() FT_FSELECT() |
FT_FWRITELN( < cData >, [ < lInsert > ] ) --> lSuccess
This function writes a line of text to the file in the currently selected text file workarea. Text lines are delimited with a CRLF pair. The record pointer is not moved.
The contents of the current record are updated to reflect the new new line written, unless the Insert option is selected.
Writing a null string has the effect of clearing the current line if in overstrike mode, else inserting a new line (same as FT_FINSERT()).
A text file "record" is a line of text terminated by a CRLF pair.
<cData> | is a string of data to write to the file at the current record position. |
<lInsert> | is a logical indicating whether the contents of the current record are to be preserved, that is, if lInsert evaluates to .T., the a new record is inserted at the current position. The current record then is pushed down to FT_FRECNO()+1. If lInsert is .F. or omitted, the current record is replaced by cData. |
Returns : | TRUE if successful, otherwise check ^ft_fError()^n for error code. |
See also : | FT_FREADLN() FT_FRECNO() FT_FINSERT() FT_FDELETE() |
FWRITE(<nHandle>, <cBuffer>, [<nBytes>]) --> nBytesWritten
FWRITE() is a low-level file function that writes data to an open binary file from a character string buffer. You can either write all or a portion of the buffer contents. Writing begins at the current file position, and the function returns the actual number of bytes written.
If FWRITE() results in an error condition, FERROR() can be used to determine the specific error.
Warning! This function allows low-level access to DOS files and devices. It should be used with extreme care and requires a thorough knowledge of the operating system
<nHandle> | is the file handle obtained from FOPEN(), FCREATE(), or predefined by DOS. |
<cBuffer> | is the character string to write to the specified file. |
<nBytes> | indicates the number of bytes to write beginning at the current file pointer position. If omitted, the entire content of |
<cBuffer> | is written. |
Returns : | FWRITE() returns the number of bytes written as an integer numeric value. If the value returned is equal to <nBytes>, the operation was successful. If the return value is less than <nBytes> or zero, either the disk is full or another error has occurred. |
See also : | FCLOSE() FCREATE() FERROR() FOPEN() I2BIN() L2BIN() |
OUTERR(<exp list>) --> NIL
OUTERR() is identical to OUTSTD() except that it writes to the standard error device rather than the standard output device. Output sent to the standard error device bypasses the xClipper console and output devices as well as any DOS redirection. It is typically used to log error messages in a manner that will not interfere with the standard screen or printer output.
OUTSTD(<exp list>) --> NIL
OUTSTD() is a simple output function similar to QOUT() except that it writes to the STDOUT device (instead of to the xClipper console output stream). Programs with very simple output requirements (i.e., that perform no full-screen input or output) can use this function to avoid loading the terminal output subsystems. The header file Simplio.ch redefines the ? and ?? commands to use the OUTSTD() function.
Since OUTSTD() sends its output to the standard output device, the output can be redirected using the DOS redirection symbols (>, >, |). This lets you redirect output from a xClipper program to a file or pipe. Refer to your PC/MS-DOS documentation for more information about this operating system facility.