file class

I/O device that operates on files
This object class provides access to files - basic I/O operations, copying, removing etc...
Sets the file name to <file_name>. It does not move the file, it just changes the file the object is "pointing to". You can not change names of already open files.
See also: $open(), $name().
<string> $name()
Returns name set by $setName().
See also: $setName().
$open(<mode1:string>, <mode2:string>)
Attempts to open the file in specified mode or modes "sum". Valid modes are:
 Raw          - raw, non-buffered access
ReadOnly - opens the file read-only
WriteOnly - opens the file write-only
ReadWrite - opens the file in read-write mode
Append - opens the file in append mode. The file index is set to the end of the file.
Truncate - truncates the file
If you call this function without any parameters, the file is opened in ReadOnly mode.
When working with buffered files, data is not written directly to the file at once. You must call $flush() to force it.
See also: $close(), $flush().
<boolean> $isOpen()
Returns '1' if the file is open, '0' otherwise.
Closes the file, flushing the buffers first.
See also: $flush().
Flushes the file buffer to disk. Calling this after opening the file in 'Raw' mode doesn't make much sense.
See also: $open(), $close().
<integer> $size()
Returns current file size.
<boolean> $atEnd()
Returns '1' if you have reached end of the file, '0' otherwise.
See also: $seek(), $where().
<integer> $where()
Returns current position in the file (file index).
See also: $seek().
Sets the file index to <index>.
See also: $where(), $atEnd().
Writes character <char> to the file and increments file index.
See also: $getch(), $ungetch().
<char> $getch()
Reads a character from the file and increments file index.
See also: $putch(), $ungetch().
Puts the character <char> back to the file and decrements the file index. This is usually called to undo a $getch() call.
See also: $getch, $putch().
Reads a line of text from the file and increments file index.
Appends a line of text to the end of the file. $readBlock() $writeBlock() $writeHex() $readHex()

Index, Object Classes
KVIrc 3.9.99 Documentation
Generated by root at Wed Oct 17 19:34:06 2007