ajfile


Data type AjPFile

Ajax file object. Holds information for an open (unbuffered) input or output file.

On output, conversion code "%F" writes the filename.

Alias name(s)

NameDescription
AjSFile
AjOFile

Constructor(s)

NameDescription
ajFileNewDefault constructor for an input file
ajFileNewFConstructor using an existing open file, for example stdin or stdout
ajFileNewInConstructor using a filename for an input file
ajFileNewAppDefault constructor using a filename for an output file to be opened for appending records to the end of the file
ajFileNewOutDefault constructor using a filename for an output file
ajFileNewInPipeConstructor using output from a forked command
ajFileNewInListConstructor using an AjPList of filenames

Destructor(s)

NameDescription
ajFileCloseDefault destructor

Modifier(s)

NameDescription
ajFileGetsReads a record from a file
ajFileGetsTrimReads a record from a file and removes newline characters

Cast(s)

NameDescription
ajFileNameReturns the filename as char
ajFileNameSReturns the filename as an AjPStr
ajFileFpReturns the equivalent C file pointer
ajFileGetAppReturns the App element.

Other related data structure(s)

NameDescription
AjPFileBuffBuffered input file.

Attributes

NameTypeDescription
fpC file pointer
HandleAJAX file number 0 if unused
NameFile name as used when opening
ListList of file names (first is open)
EndTrue if EOF has been reached
AppTrue if file was opened for append.
BuffBuffer for latest line read
PidProcess PID if any


Data type AjPFileBuffList

Ajax file buffer, holding a simple linked list of buffered lines. This does not use the AjPList objects.

This is a substructure of the AjPFileBuff object.

Attributes

NameTypeDescription
LineString : this line
NextNext line in the list, NULL for last
FposFile offset for start of this line


Data type AjPFileBuff

Ajax buffered file object. Holds information for a buffered input file.

Alias name(s)

NameDescription
AjSFileBuff
AjOFileBuff

Constructor(s)

NameDescription
ajFileBuffNewDefault constructor for an input file
ajFileBuffNewFConstructor using an existing open file, for example stdin or stdout.
ajFileBuffNewInConstructor using a filename
ajFileBuffNewSConstructor using a line of buffered data
ajFileBuffNewDWConstructor using a directory and wildcard filename
ajFileBuffNewInListConstructor using a list of filenames

Destructor(s)

NameDescription
ajFileBuffDelDefault destructor

Modifier(s)

NameDescription
ajFileBuffNobuffTurns off input buffering.
ajFileBuffResetResets so the next read uses the first buffered line
ajFileBuffClearDeletes unwanted old lines from the buffer but can keep the most recent line(s) for reuse.
ajFileBuffStripHtmlProcesses data in the file buffer, removing HTML tokens

Input

NameDescription
ajFileBuffLoadReads all input lines from a file into the buffer.

Modifier(s)

NameDescription
ajFileBuffGetReads a line from a buffered file.
ajFileBuffGetStoreReads a line from a buffered file with append.
ajFileBuffGetStoreLReads a line from a buffered file with append.

Operator(s)

NameDescription
ajFileBuffEmptyTests whether a file buffer is empty.
ajFileBuffTraceWrites debug messages to indicate the contents of a buffered file.

Cast(s)

NameDescription
ajFileBuffFileReturns the equivalent AjPFile without the buffer access.

Operator(s)

NameDescription
ajFileBuffTraceFullWrites debug messages to show the full contents of a buffered file.

Cast(s)

NameDescription
ajFileBuffIsBufferedTests for input buffering.

Other related data structure(s)

NameDescription
AjPFileSimple input file.

Attributes

NameTypeDescription
FileThe input file - data to be buffered
LinesAll lines ... where the data really is
FreelinesFree list of lines for reuse
CurrCurrent line in Lines list
PrevPrevious line (points to Curr for delete)
LastLast line for quick appending
FreelastLast free line for quick append
Nobuffif true, do not buffer the file
PosPosition in list
SizeSize of list
FreeSizeSize of free list
FposFile position in File


Data type AjPDir

Ajax directory object. Holds information for an open input or output directory.

Alias name(s)

NameDescription
AjSDir
AjODir

Constructor(s)

NameDescription
ajDirNewDefault constructor for a directory
ajDirNewSDirectory constructor with extension
ajDirNewSSDirectory constructor with prefix and extension
ajDiroutNewDefault constructor for an output directory
ajDiroutNewSOutput directory constructor with extension
ajDiroutNewSSOutput directory constructor with prefix and extension

Destructor(s)

NameDescription
ajDirDelDefault destructor
ajDiroutDelDefault destructor for output directory

Attributes

NameTypeDescription
NamePath
PrefixDefault filename prefix
ExtensionDefault file extension
OutputTrue if to be used for output


Data type AjPOutfile

Ajax file object. Holds information for an open (unbuffered) input or output file.

On output, conversion code "%F" writes the filename.

Alias name(s)

NameDescription
AjSOutfile
AjOOutfile

Constructor(s)

NameDescription
ajOutfileNewDefault constructor for an output file

Destructor(s)

NameDescription
ajOutfileCloseClose file and descruct
ajOutfileDelDefault destructor

Attributes

NameTypeDescription
FileFile object
TypeNamed data file type
ItypeIndex number for Type
FormatstrFormat specific for this data type
FormatIndex for Formatstr for this data type