doc/text/io.txt
author Timm S. Mueller <tmueller@neoscientists.org>
Sat, 18 Jul 2009 22:28:26 +0200
changeset 270 418c081f184c
parent 171 8dfec9d17f20
permissions -rwxr-xr-x
Visual module: Minor compatibility fixes merged from tekUI
     1 
     2 =( Index : TEKlib / Io module reference manual )=
     3 
     4 -------------------------------------------------------------------------------
     5 
     6 TEKlib provides a filesystem namespace for any number of mountpoints
     7 (''devices'') and logical roots (''assigns''). ''Handlers'' are modules
     8 implementing specific roots in the filesystem; they can be mounted
     9 explicitely or initialize themselves on demand. On most platforms the
    10 filesystem is initially populated with a 'default handler' that occupies the
    11 root node, thus abstracting from a host's native filesystem. See the
    12 [[#Introduction]] section for details.
    13 
    14 ===( Open and close )===
    15 
    16 	TOpenFile()         || Open file
    17 	TCloseFile()        || Close file
    18 
    19 ===( Unbuffered I/O )===
    20 
    21 	TRead()             || Read from file
    22 	TWrite()            || Write to file
    23 	TSeek()             || Set the position for reading and writing
    24 
    25 ===( File I/O, buffered )===
    26 
    27 	TFlush()            || Flush file buffers
    28 	TFRead()            || Read from file
    29 	TFWrite()           || Write to file
    30 	TFPutC()            || Put character to file
    31 	TFGetC()            || Read character from file
    32 	TFUngetC()			|| Put back character to file
    33 	TFGetS()			|| Read string from file
    34 	TFPutS()			|| Write string to file
    35 	TFEoF()             || Test End-Of-File condition
    36 
    37 ===( Locks )===
    38 
    39 	TLockFile()         || Lock a file or directory
    40 	TUnlockFile()       || Release a lock
    41 	TExamine()          || Examine lock or file
    42 	TExNext()           || Examine next in a directory
    43 	TDupLock()          || Duplicate a lock
    44 	TChangeDir()        || Change current directory to lock
    45 	TParentDir()        || Get lock on parent of a lock
    46 	TOpenFromLock()     || Turn an open lock into a file
    47 
    48 ===( Filesystem operations )===
    49 
    50 	TRename()           || Rename an object
    51 	TDeleteFile()       || Delete a disk object
    52 	TMakeDir()          || Make a directory
    53 	TSetFileDate()      || Set datestamp of a filesystem object
    54 
    55 ===( Namespace operations )===
    56 
    57 	TMount()            || Mount/unmount a device
    58 	TMakeName()         || Make a path/filename
    59 	TAssignLock()       || Create a logical assign to lock
    60 	TAssignLate()       || Create a logical assign to name
    61 	TNameOf()           || Return name of lock or file
    62 	TAddPart()          || Add a path component to a path
    63 
    64 ===( Misc )===
    65 
    66 	TInputFH()			|| Get the task's standard input handle
    67 	TOutputFH()			|| Get the task's standard output handle
    68 	TErrorFH()			|| Get the task's standard error handle
    69 	TGetIOErr()         || Get last I/O error code in current context
    70 	TSetIOErr()         || Set I/O error in current context
    71 	TFault()            || Return text representation of an error
    72 
    73 ===( Asynchronous I/O )===
    74 
    75 	TObtainPacket()     || Allocate an I/O message
    76 	TReleasePacket()    || Free an I/O message
    77 
    78 
    79 ==( Introduction )==
    80 
    81 
    82 === Device names ===
    83 
    84 		:
    85 
    86 The colon stands for the root of the "default" filesystem.
    87 
    88 Typically this is the device from which TEKlib was started, e.g. the
    89 filesystem root in the host operating system. If the host operating
    90 system has multiple roots then all drives will show up in this list.
    91 Under Windows, for example, the contents of {{:}} is a listing of
    92 single-letter entries like {{A}}, {{C}}, {{D}}.
    93 
    94 Names preceding the colon address devices explicitely:
    95 
    96 		work:
    97 
    98 This would address a device named {{work}}.
    99 
   100 		stdio:out
   101 
   102 This would address a file named {{out}} on a device named {{stdio}}.
   103 
   104 Named devices can have different origins:
   105 
   106 	* The device is mounted using TMount(), and by that means the
   107 	name is bound to an instance of an I/O handler.
   108 
   109 	* The name is a logical assign. Logical assigns can be obtained
   110 	with functions like TAssignLock() or TAssignLate().
   111 
   112 	* The device is mounted automatically on the first attempt to
   113 	access it by name.
   114 
   115 Handlers can place logical assigns in the I/O namespace during
   116 initialization. The default handler will supply the following
   117 late-binding assigns (more may follow in the future):
   118 
   119 		progdir:
   120 
   121 This is the directory in which the application resides in the host
   122 filesystem. E.g. this would point to {{:home/paul/tek}} if Paul
   123 started {{~/tek/coolapp}} on his Unix account (regardless of his
   124 current directory).
   125 
   126 		sys:
   127 
   128 TEKlib's system directory in the host filesystem. Under BSD, for
   129 example, this would point to {{:usr/local/tek}}, on the Amiga
   130 platform this would be {{:TEKLIB}} and under a German-localised
   131 installation of Windows {{:C/Programme/Gemeinsame Dateien/tek}}.
   132 
   133 === Path components ===
   134 
   135 Path components are separated by slashes. A freestanding slash refers to
   136 the parent directory. This is different from some other filesystems and
   137 can lead to confusion; while {{foo/bar}} and {{foo//bar}} are treated
   138 equally in Unix, this is not true for TEKlib, where {{foo//bar}} would
   139 have the same effect as {{bar}}.
   140 
   141 		/
   142 
   143 This would access the parent directory, like {{..}} in Windows or Unix.
   144 
   145 		//foo
   146 
   147 This would access the directory {{foo}} in the parent of the parent
   148 directory, like e.g. {{..\..\foo}} in Windows.
   149 
   150 		progdir:/
   151 
   152 This would address the parent relative to the directory in which
   153 the application resides.
   154 
   155 The Io module has a support function for the composition of
   156 path names, TAddPart(). It takes care of these rules.
   157 
   158 The current directory can be addressed with an {{""}} (empty
   159 string). The empty string is equivalent to {{.}} on many other
   160 operating systems.
   161 
   162 === Name conversion ===
   163 
   164 {{.}} and {{..}} are ambiguous for the default handler on many operating
   165 systems and should be avoided. When directory contents are
   166 scanned, {{.}} and {{..}} will not show up in the application unless
   167 they refer to regular files or directories on the given host.
   168 
   169 Future implementations of TEKlib's default filesystem handler
   170 may implement more rigid checking and reject more filenames and
   171 special characters.
   172 
   173 === Case sensitivity ===
   174 
   175 Current implementations of the TEKlib default handler in no way
   176 try to abstract from (or enforce) case-sensitivity (or
   177 insensitivity) in their underlying host filesystem. Prepare your
   178 application to deal with case-sensitive names, and be prepared
   179 for (but do not depend on) multiple occurances of the same name
   180 with different uppercase/lowercase combinations.
   181 
   182 
   183 =={ TLockFile }==
   184 
   185 NAME::
   186 	TLockFile - Lock a file or directory
   187 
   188 SYNOPSIS::
   189 		lock = TIOLockFile(TIOBase, name,   mode, tags)
   190 		TAPTR              TAPTR    TSTRPTR TINT  TTAGITEM*
   191 
   192 		lock = TLockFile(name,   mode, tags)
   193 		TAPTR            TSTRPTR TINT  TTAGITEM*
   194 
   195 FUNCTION::
   196 	Locate a named file or directory, lock out other accessors,
   197 	and return a handle that allows for examination of the object.
   198 
   199 	The mode determines the type of access locking:
   200 
   201 	TFLOCK_READ
   202 		Attempts a shared lock. Multiple shared
   203 		locks on a file or directory can succeed.
   204 
   205 	TFLOCK_WRITE
   206 		Attempts an exclusive lock. Only one
   207 		exclusive lock can be held on an object
   208 		at a time.
   209 
   210 	When the object is not found or cannot be locked then the
   211 	return value is TNULL; a secondary error code can be
   212 	obtained using TGetIOErr().
   213 
   214 INPUTS::
   215 	- {{name}} - Name of the file or directory
   216 	- {{mode}} - Access mode
   217 	- {{tags}} - Pointer to an array of tag items
   218 
   219 TAGS::
   220 	None defined yet
   221 
   222 RESULTS::
   223 	- {{lock}} - Lock handle, or TNULL if failed
   224 
   225 NOTES::
   226 	* Exclusive locks to directories are not guaranteed to work
   227 	universally. Some platform-specific handlers may choose to
   228 	grant only shared locks on directories.
   229 	* As of this writing, not all filesystem handlers actually
   230 	implement all locking modes. The POSIX filesystem handler,
   231 	for example, does not currently use fcntl or a similar
   232 	mechanism to lock out other accessors.
   233 
   234 SEE ALSO::
   235 	TUnlockFile(), TExamine(), TOpenFile(), TOpenFromLock(),
   236 	TMakeDir()
   237 
   238 =={ TUnlockFile }==
   239 
   240 NAME::
   241 	TUnlockFile - Release a lock
   242 
   243 SYNOPSIS::
   244 		TIOUnlockFile(TIOBase, lock)
   245 		              TAPTR    TAPTR
   246 
   247 		TUnlockFile(lock)
   248 		            TAPTR
   249 
   250 FUNCTION::
   251 	Unlock and free a handle obtained with TLockFile(), TDupLock(),
   252 	TParentDir() or TMakeDir(). Each lock claimed somewhere
   253 	must be unlocked once (and only once).
   254 
   255 INPUTS::
   256 	- {{lock}} - Lock to release
   257 
   258 SEE ALSO::
   259 	TLockFile(), TDupLock(), TParentDir()
   260 
   261 =={ TOpenFile }==
   262 
   263 NAME::
   264 	TOpenFile - Open file
   265 
   266 SYNOPSIS::
   267 		file = TIOOpenFile(TIOBase, name,   mode, tags)
   268 		TAPTR              TAPTR    TSTRPTR TUINT TTAGITEM*
   269 
   270 		file = TOpenFile(name,   mode, tags)
   271 		TAPTR            TSTRPTR TUINT TTAGITEM*
   272 
   273 FUNCTION::
   274 	The named file is opened and a file handle returned. Name can
   275 	be a device name such as "foo:", an absolute path such as
   276 	"foo:bar", or a path relative to the current directory, like
   277 	"foo/bar".
   278 
   279 	The mode argument determines the access and arbitration type
   280 	for the file:
   281 
   282 	TFMODE_READONLY
   283 		An existing file is opened for read access
   284 		only; no attempts are made to lock out other
   285 		accessors.
   286 
   287 	TFMODE_OLDFILE
   288 		An existing file is opened for read/write
   289 		access; no attempts are made to lock out
   290 		other accessors.
   291 
   292 	TFMODE_NEWFILE
   293 		This opens a new file for read/write access.
   294 		The file will be locked exclusively, i.e.
   295 		no other accessors are allowed at the same
   296 		time. If a file of that name existed, it is
   297 		truncated to a length of zero bytes.
   298 
   299 	TFMODE_READWRITE
   300 		Opens a new or existing file for read/write
   301 		access, locked in shared mode, i.e. other
   302 		accessors are allowed to read from the file
   303 		at the same time.
   304 
   305 	When the file cannot be opened then this function returns TNULL,
   306 	and a secondary error code is available by calling TGetIOErr().
   307 
   308 INPUTS::
   309 	- {{name}} - Name of the file to open
   310 	- {{mode}} - Access and arbitration mode
   311 	- {{tags}} - Pointer to an array of tag items
   312 
   313 TAGS::
   314 	None defined currently
   315 
   316 RESULTS::
   317 	- {{file}} - File handle, or TNULL if failed
   318 
   319 NOTES::
   320 	* TFMODE_READONLY should be the preferred mode if you need no
   321 	write access or locking. Note, for example, that it is common
   322 	behavior under Windows that files copied from a CD-Rom are
   323 	write-protected.
   324 
   325 	* As of this writing, not all filesystem handlers actually
   326 	implement all locking modes. The POSIX filesystem handler,
   327 	for example, does not currently use fcntl or a similar
   328 	mechanism to lock out other accessors.
   329 
   330 SEE ALSO::
   331 	TCloseFile(), TLockFile(), TOpenFromLock()
   332 
   333 =={ TCloseFile }==
   334 
   335 NAME::
   336 	TCloseFile - Close a file
   337 
   338 SYNOPSIS::
   339 		success = TIOCloseFile(TIOBase, file)
   340 		TBOOL                  TAPTR    TAPTR
   341 
   342 		success = TCloseFile(file)
   343 		TBOOL                TAPTR
   344 
   345 FUNCTION::
   346 	Close a file that was opened with TOpenFile().
   347 
   348 	The return value indicates whether outstanding write operations,
   349 	buffers flushes and the like were successful. If the close
   350 	operation failed, the file handle has been deallocated anyway
   351 	and may not be used any longer.
   352 
   353 	All file handles that have been opened explicitely must be
   354 	closed explicitely, once and only once.
   355 
   356 INPUTS::
   357 	- {{file}} - Filehandle from TOpenFile() or TOpenFromLock()
   358 
   359 SEE ALSO::
   360 	TOpenFile(), TOpenFromLock()
   361 
   362 =={ TRead }==
   363 
   364 NAME::
   365 	TRead - Read from a file
   366 
   367 SYNOPSIS::
   368 		rdlen = TIORead(TIOBase, file, buffer, buflen)
   369 		TINT            TAPTR    TAPTR TAPTR   TINT
   370 
   371 		rdlen = TRead(file, buffer, buflen)
   372 		TINT          TAPTR TAPTR   TINT
   373 
   374 FUNCTION::
   375 	This function reads a block of data from an open file
   376 	into the buffer specified. The buflen argument is the size
   377 	of the buffer, i.e. the maximum number of bytes that can
   378 	be read in this operation.
   379 
   380 	The return value, if greater than zero, is the number of
   381 	bytes that have been read successfully. An End-Of-File
   382 	condition is indicated by a return value of zero. An error
   383 	is indicated with a return value of -1, in which case
   384 	additonal error diagnostics can be obtained with the
   385 	TGetIOErr() function.
   386 
   387 INPUTS::
   388 	- {{file}} - File handle
   389 	- {{buffer}} - Buffer to read into
   390 	- {{len}} - Maximum number of bytes to read
   391 
   392 RESULTS::
   393 	- {{rdlen}} - Number of bytes read, or -1 if an error occured
   394 
   395 NOTES::
   396 	* This function implements no buffering. The I/O request
   397 	will be directly forwarded to the underlying handler. Small
   398 	reads are performed very inefficiently with this function.
   399 
   400 	* For switching from buffered I/O calls back to unbuffered
   401 	functions like this, you must call TFlush().
   402 
   403 SEE ALSO::
   404 	TWrite(), TFWrite(), TOpenFile(), TFGetC()
   405 
   406 =={ TWrite }==
   407 
   408 NAME::
   409 	TWrite - Write to a file
   410 
   411 SYNOPSIS::
   412 		wrlen = TIOWrite(TIOBase, file, buffer, buflen)
   413 		TINT             TAPTR    TAPTR TAPTR   TINT
   414 
   415 		wrlen = TWrite(file, buffer, buflen)
   416 		TINT           TAPTR TAPTR   TINT
   417 
   418 FUNCTION::
   419 	This function writes a block of data from the buffer specified
   420 	to an open file handle. The buflen argument is the size of the
   421 	buffer, i.e. the maximum number of bytes that will be written
   422 	in this operation.
   423 
   424 	The return value, if greater than zero, is the number of
   425 	bytes that have been written successfully. An error is
   426 	indicated with a return value of -1, in which case additonal
   427 	error diagnostics can be obtained with the TGetIOErr() function.
   428 
   429 INPUTS::
   430 	- {{file}} - File handle
   431 	- {{buffer}} - Buffer to write
   432 	- {{len}} - Number of bytes to write
   433 
   434 RESULTS::
   435 	- {{rdlen}} - Number of bytes written, or -1 if an error occured
   436 
   437 NOTES::
   438 	* This function implements no buffering. The I/O request
   439 	will be directly forwarded to the underlying handler. Small
   440 	writes are performed very inefficiently with this function.
   441 
   442 	* For switching from buffered I/O calls back to unbuffered
   443 	functions like this, you must call TFlush().
   444 
   445 SEE ALSO::
   446 	TWrite(), TFWrite(), TOpenFile(), TFGetC()
   447 
   448 =={ TFlush }==
   449 
   450 NAME::
   451 	TFlush - Flush file buffers
   452 
   453 SYNOPSIS::
   454 		success = TIOFlush(TIOBase, file)
   455 		TBOOL              TAPTR    TAPTR
   456 
   457 		success = TFlush(file)
   458 		TBOOL            TAPTR
   459 
   460 FUNCTION::
   461 	Flush buffers from a file handle and readjust the internal
   462 	read/write cursor. Calling this function is mandatory if you
   463 	want to switch from buffered I/O functions like TFPutC()
   464 	back to unbuffered functions like TWrite().
   465 
   466 	The return value will be TFALSE to indicate that an error
   467 	occured while writing out buffers or while seeking to the
   468 	last read position.
   469 
   470 INPUTS::
   471 	- {{file}} - File handle to flush
   472 
   473 RESULTS::
   474 	- {{success}} - TTRUE if flushing succeded, TFALSE on error.
   475 
   476 	In the case of an error, more detailed information is
   477 	available via TGetIOErr().
   478 
   479 NOTES::
   480 	Buffers are automatically flushed when a filehandle is
   481 	closed.
   482 
   483 SEE ALSO::
   484 	TFPutC(), TFGetC(), TFWrite(), TFWrite(), TRead(), TWrite()
   485 
   486 =={ TSeek }==
   487 
   488 NAME::
   489 	TSeek - Set the position for reading and writing
   490 
   491 SYNOPSIS::
   492 		filepos = TIOSeek(TIOBase, file, offset, offs_hi, mode)
   493 		TUINT             TAPTR    TAPTR TINT    TINT*    TINT
   494 
   495 		filepos = TSeek(file, offset, offs_hi, mode)
   496 		TUINT           TAPTR TINT    TINT*    TINT
   497 
   498 FUNCTION::
   499 	This function moves the read/write cursor in a file to a new
   500 	position and returns the resulting position measured in bytes
   501 	from the beginning of the file.
   502 
   503 	The offset specifies the number of bytes for moving the cursor,
   504 	either relative to the current position or to an absolute
   505 	position from either the beginning or the end of the file,
   506 	according to the mode argument:
   507 
   508 	TFPOS_CURRENT
   509 		Offset is the number of bytes to move the
   510 		cursor towards the end of the file, relative
   511 		to the current position. Seek 0 from current
   512 		to find out where you are.
   513 
   514 	TFPOS_BEGIN
   515 		Offset is the absolute number of bytes from the
   516 		beginning of the file.
   517 
   518 	TFPOS_END
   519 		Offset is the absolute number of bytes from the
   520 		end of the file.
   521 
   522 	When the offs_hi argument is TNULL then this function can operate
   523 	only on files not larger than 2^32-2 bytes. Errors are indicated
   524 	with a return value of {{0xffffffff}}. Use TGetIOErr() in this case
   525 	to get extended error diagnostics.
   526 
   527 	When offs_hi is specified then it is a pointer to a 64 bit offset's
   528 	high-order 32 bits. If the function fails then the return value is
   529 	{{0xffffffff}}, and TGetIOErr() returns a secondary error code other
   530 	than {{TIOERR_SUCCESS}}. The integer being pointed to also receives
   531 	the high-order 32 bits of the resulting file position.
   532 
   533 INPUTS::
   534 	- {{file}} - File handle
   535 	- {{offset}} - Number of bytes to seek
   536 	- {{offs_hi}} - Pointer to offset's high-order 32 bits, or TNULL
   537 	- {{mode}} - Seek mode
   538 
   539 RESULTS::
   540 	- {{filepos}} - Lower 32 bits of new absolute position, or {{0xffffffff}}.
   541 
   542 	An error is indicated with a return value of {{0xffffffff}}. If the
   543 	offs_hi argument was specified then you ''must'' call TGetIOErr() to
   544 	distinguish an error from a valid file position.
   545 
   546 SEE ALSO::
   547 	TRead(), TWrite()
   548 
   549 =={ TFPutC }==
   550 
   551 NAME::
   552 	TFPutC - Write a character, buffered
   553 
   554 SYNOPSIS::
   555 		char = TIOFPutC(TIOBase, file, char)
   556 		TINT            TAPTR    TAPTR TINT
   557 
   558 		char = TFPutC(file, char)
   559 		TINT          TAPTR TINT
   560 
   561 FUNCTION::
   562 	Write a single character to an open file, buffered.
   563 
   564 INPUTS::
   565 	- {{file}} - File to write to
   566 	- {{char}} - Character to write
   567 
   568 RESULTS::
   569 	- {{char}} - the character written, or TEOF if an error occured
   570 
   571 NOTES::
   572 	After using this function, call TFlush() before switching
   573 	back to unbuffered I/O functions.
   574 
   575 SEE ALSO::
   576 	TFlush(), TFGetC(), TRead(), TOpenFile()
   577 
   578 =={ TFGetC }==
   579 
   580 NAME::
   581 	TFGetC - Read a character, buffered
   582 
   583 SYNOPSIS::
   584 		char = TIOFGetC(TIOBase, file)
   585 		TINT            TAPTR    TAPTR
   586 
   587 		char = TFGetC(file)
   588 		TINT          TAPTR
   589 
   590 FUNCTION::
   591 	Read the next character from a file. This call is buffered.
   592 
   593 INPUTS::
   594 	- {{file}} - File to read from
   595 
   596 RESULTS::
   597 	- {{char}} - next character, or TEOF if the end of the file was reached.
   598 
   599 NOTES::
   600 	After using this function, call TFlush() before switching
   601 	back to unbuffered I/O functions.
   602 
   603 SEE ALSO::
   604 	TFlush(), TFPutC(), TFUngetC(), TRead(), TOpenFile()
   605 
   606 =={ TFEoF }==
   607 
   608 NAME::
   609 	TFEoF - Determine End-Of-File condition, buffered
   610 
   611 SYNOPSIS::
   612 		status = TIOFEoF(TIOBase, file)
   613 		TBOOL            TAPTR    TAPTR
   614 
   615 		status = TFEoF(file)
   616 		TBOOL          TAPTR
   617 
   618 FUNCTION::
   619 	Check if a file has reached an End-Of-File condition. This
   620 	function will basically call TFGetC() in order to test for
   621 	more characters being available, and push the character back
   622 	into the buffer.
   623 
   624 INPUTS::
   625 	- {{file}} - File handle to check
   626 
   627 RESULTS::
   628 	- {{success}} - TTRUE if End-Of-File reached, else TFALSE
   629 
   630 NOTES::
   631 	After using this function, call TFlush() before switching
   632 	back to unbuffered I/O functions.
   633 
   634 SEE ALSO::
   635 	TFGetC(), TFlush()
   636 
   637 =={ TFRead }==
   638 
   639 NAME::
   640 	TFRead - Read from a file, buffered
   641 
   642 SYNOPSIS::
   643 		rdlen = TIOFRead(TIOBase, file, buffer, buflen)
   644 		TINT             TAPTR    TAPTR TAPTR   TINT
   645 
   646 		rdlen = TFRead(file, buffer, buflen)
   647 		TINT           TAPTR TAPTR   TINT
   648 
   649 FUNCTION::
   650 	This function reads a block of data from an open file into
   651 	the specified buffer. The buflen argument is the size of the
   652 	buffer, i.e. the maximum number of bytes that may be read
   653 	during this operation.
   654 
   655 	The return value, if greater than zero, is the number of
   656 	bytes that have been read successfully. An End-Of-File
   657 	condition is indicated with a return value of zero. An error
   658 	is indicated with a return value of -1, in which case
   659 	additional error information can be obtained with a call
   660 	to TGetIOErr().
   661 
   662 	Unlike TRead() this function operates on the file in buffered
   663 	mode.
   664 
   665 INPUTS::
   666 	- {{file}} - File handle
   667 	- {{buffer}} - Buffer to read into
   668 	- {{buflen}} - Number of bytes to read
   669 
   670 RESULTS::
   671 	- {{rdlen}} - Number of bytes read, or -1 if an error occured
   672 
   673 NOTES::
   674 	After using a buffered function, call TFlush() before switching
   675 	back to unbuffered I/O functions like TRead().
   676 
   677 SEE ALSO::
   678 	TFWrite(), TRead(), TOpenFile(), TFGetC()
   679 
   680 =={ TFWrite }==
   681 
   682 NAME::
   683 	TFWrite - Write to a file, buffered
   684 
   685 SYNOPSIS::
   686 		wrlen = TIOFWrite(TIOBase, file, buffer, buflen)
   687 		TINT              TAPTR    TAPTR TAPTR   TINT
   688 
   689 		wrlen = TFWrite(file, buffer, buflen)
   690 		TINT            TAPTR TAPTR   TINT
   691 
   692 FUNCTION::
   693 	This function writes a block of data from the specified buffer
   694 	to an open file handle. The buflen argument is the size of the
   695 	buffer, i.e. the maximum number of bytes that can be written
   696 	during this operation.
   697 
   698 	The return value, if greater than zero, is the number of
   699 	bytes that have been written successfully. An error is
   700 	indicated with a return value of -1, in which case additonal
   701 	error informations can be obtained with a call to TGetIOErr().
   702 
   703 	Unlike TWrite() this function operates on the file in buffered mode.
   704 
   705 INPUTS::
   706 	- {{file}} - File handle
   707 	- {{buffer}} - Buffer to write
   708 	- {{buflen}} - Number of bytes to write
   709 
   710 RESULTS::
   711  - {{rdlen}} - Number of bytes actually written, or -1 if an error occured
   712 
   713 NOTES::
   714 	After using a buffered function, call TFlush() before switching
   715 	back to unbuffered I/O functions like TRead().
   716 
   717 SEE ALSO::
   718 	TFWrite(), TWrite(), TOpenFile(), TFGetC()
   719 
   720 =={ TExamine }==
   721 
   722 NAME::
   723 	TExamine - Examine a lock or filehandle
   724 
   725 SYNOPSIS::
   726 		numattr = TIOExamine(TIOBase, object, tags)
   727 		TINT                 TAPTR    TAPTR   TTAGITEM*
   728 
   729 		numattr = TExamine(object, tags)
   730 		TINT               TAPTR   TTAGITEM*
   731 
   732 FUNCTION::
   733 	Examine a lock or an open filehandle and query attributes via
   734 	a list of tagitems. The return value will be the number of
   735 	attributes that could be retrieved. Note that you may have to
   736 	check the return value, because not all filesystem handlers
   737 	must implement all possible attributes. A general error is
   738 	indicated with a return value of -1, in which case you can
   739 	use TGetIOErr() for getting more detailed information.
   740 
   741 	Use TExNext() for scanning the contents of a directory you have
   742 	a lock on.
   743 
   744 INPUTS::
   745 	- {{object}} - Lock or file handle to examine
   746 	- {{tags}} - Pointer to a list of tag items
   747 
   748 TAGS::
   749 	TFATTR_Name, (TSTRPTR *)
   750 		Query the object's name. Tag data must be the address of a
   751 		string variable, which will receive a pointer to the name.
   752 		Warning: This pointer will become invalid as soon as you
   753 		call TExNext() the next time or TUnlockFile(). You MUST
   754 		make a copy of the string if you wish to continue to work
   755 		with the name after that.
   756 
   757 	TFATTR_Type, (TINT *)
   758 		Query the object type. Tag data must be the address of an
   759 		integer, which will receive a type code for the object:
   760 
   761 		TFTYPE_File
   762 			Regular file
   763 
   764 		TFTYPE_Directory
   765 			Regular directory
   766 
   767 		TFTYPE_Volume
   768 			Entry is a physical, removable, or a logical drive in
   769 			the host filesystem.
   770 
   771 		TFTYPE_Unknown
   772 			Object type is unknown
   773 
   774 		More types may follow in the future, so you are advised to
   775 		treat file, directory and volume as flags; e.g. every volume
   776 		is also a directory, and if you are only interested in the
   777 		directory information, use (type & TFTYPE_Directory). Note:
   778 		Better leave entries of the type TFTYPE_Unknown alone as they
   779 		do not currently fit into TEKlib's namespace semantics.
   780 
   781 	TFATTR_Size, (TINT *)
   782 		Query the object's size in bytes. Tag data must be the address
   783 		of an integer, which will receive the size of the object
   784 		in bytes. Note that the size of directory entries will
   785 		always be zero.
   786 
   787 	TFATTR_Date, (TDATE *)
   788 		Query the object's last modification date.  Tag data must be
   789 		the address of a TDATE structure, which will receive a TEKlib
   790 		datestamp for the object in question.
   791 
   792 	TFATTR_DateBox, (struct TDateBox *)
   793 		Query the object's last modification date. Tag data must be
   794 		the address of a TDateBox structure, which will receive a
   795 		datestamp for the object in question. The TDateBox
   796 		structure is defined in tek/mod/time.h.
   797 
   798 RESULTS::
   799 	- {{numattr}} - Number of attributes queried, or -1 on error
   800 
   801 SEE ALSO::
   802 	TExNext(), TLockFile(), TUnlockFile(), TOpenFile()
   803 
   804 =={ TExNext }==
   805 
   806 NAME::
   807 	TExNext - Examine next in a directory
   808 
   809 SYNOPSIS::
   810 		numattr = TIOExNext(TIOBase, lock, tags)
   811 		TINT                TAPTR    TAPTR TTAGITEM*
   812 
   813 		numattr = TExNext(lock, tags)
   814 		TINT              TAPTR TTAGITEM*
   815 
   816 FUNCTION::
   817 	Examine the next entry in a locked directory, and query
   818 	attributes via a list of tag items. The return value will
   819 	be the number of attributes that could be retrieved
   820 	successfully, or -1 when all entries in the directory have
   821 	been examined. Use TGetIOErr() to distinguish the end of
   822 	a directory from a general I/O error.
   823 
   824 INPUTS::
   825 	- {{lock}} - Lock handle to examine
   826 	- {{tags}} - Pointer to a list of tag items
   827 
   828 TAGS::
   829 	See TExamine() for the possible tags.
   830 
   831 RESULTS::
   832 	numattr - Number of attributes queried, or -1 on error.
   833 
   834 SEE ALSO::
   835 	TExamine(), TLockFile()
   836 
   837 =={ TChangeDir }==
   838 
   839 NAME::
   840 	TChangeDir - Change current directory to lock
   841 
   842 SYNOPSIS::
   843 		oldlock = TIOChangeDir(TIOBase, lock)
   844 		TAPTR                  TAPTR    TAPTR
   845 
   846 		oldlock = TChangeDir(lock)
   847 		TAPTR                TAPTR
   848 
   849 FUNCTION::
   850 	Change the current task's current directory to the lock
   851 	specified. If successful, the lock on the previous current
   852 	directory will be returned to the caller. If the current task
   853 	has no current directory, or if an error occured, the return
   854 	will be TNULL. In the latter case, use TGetIOErr() to get more
   855 	details about the problem.
   856 
   857 INPUTS::
   858 	- {{lock}} - Lock handle to change the current directory to
   859 
   860 RESULTS::
   861 	oldlock - Lock of the previous current directory, or TNULL
   862 
   863 	The result will be TNULL if the current task had no current
   864 	directory or when an error occured.
   865 
   866 NOTES::
   867 	* Note that the caller becomes responsible for the lock
   868 	returned by this function. Just like any other lock, it
   869 	must be released somewhere.
   870 
   871 	* Each task in TEKlib has a currentdir of its own. Initially, it
   872 	is inherited from its parent when a new task is created.
   873 
   874 SEE ALSO::
   875 	TLockFile(), TParentDir(), TMakeDir()
   876 
   877 =={ TParentDir }==
   878 
   879 NAME::
   880 	TParentDir - Get lock on parent of a lock
   881 
   882 SYNOPSIS::
   883 		parentlock = TIOParentDir(TIOBase, lock)
   884 		TAPTR                     TAPTR    TAPTR
   885 
   886 		parentlock = TParentDir(lock)
   887 		TAPTR                   TAPTR
   888 
   889 FUNCTION::
   890 	Create a new lock on the parent directory of the lock
   891 	specified.
   892 
   893 INPUTS::
   894 	- {{lock}} - Lock handle to get parent from
   895 
   896 RESULTS::
   897 	- {{parentlock}} - Lock to the parent directory of the lock
   898 
   899 SEE ALSO::
   900 	TLockFile(), TUnlockFile(), TChangeDir(), TMakeDir()
   901 
   902 =={ TNameOf }==
   903 
   904 NAME::
   905 	TNameOf - Get the name of an object
   906 
   907 SYNOPSIS::
   908 		len = TIONameOf(TIOBase, object, buf,    buflen)
   909 		TINT            TAPTR    TAPTR   TSTRPTR TINT
   910 
   911 		len = TNameOf(object, buf,    buflen)
   912 		TINT          TAPTR   TSTRPTR TINT
   913 
   914 FUNCTION::
   915 	Get the fully qualified path and name of the object specified.
   916 	Object can be an open file handle or a lock. Buf and buflen
   917 	determine the destination buffer for the name string to be
   918 	written to. Note that the length of the destination buffer
   919 	is assumed to include an extra byte for the strings's trailing
   920 	zero. If buf and buflen are zero, only the length of the string
   921 	is calculated. In case of an error, the return value is -1.
   922 
   923 INPUTS::
   924 	- {{object}} - A lock or a file handle
   925 	- {{buf}} - Destination string buffer, or TNULL
   926 	- {{buflen}} - Length of the destination buffer, or 0
   927 
   928 RESULTS::
   929 	- {{len}} - Length of the name string, or -1 in case of an error
   930 
   931 SEE ALSO::
   932 	TLockFile(), TOpenFile(), TAddPart()
   933 
   934 =={ TDupLock }==
   935 
   936 NAME::
   937 	TDupLock - Duplicate a lock
   938 
   939 SYNOPSIS::
   940 		newlock = TIODupLock(TIOBase, lock)
   941 		TAPTR                TAPTR    TAPTR
   942 
   943 		newlock = TDupLock(lock)
   944 		TAPTR              TAPTR
   945 
   946 FUNCTION::
   947 	This function creates a duplicate of a shared lock, and
   948 	returns another lock to the same object.
   949 
   950 INPUTS::
   951 	- {{lock}} - Lock handle to duplicate
   952 
   953 RESULTS::
   954 	- {{newlock}} - A duplicate of the lock, or TNULL on error.
   955 
   956 	Use TGetIOErr() to get more detailed information in case
   957 	of failure.
   958 
   959 SEE ALSO::
   960 	TLockFile(), TChangeDir(), TUnlockFile()
   961 
   962 =={ TOpenFromLock }==
   963 
   964 NAME::
   965 	TOpenFromLock - Turn a lock into an open file
   966 
   967 SYNOPSIS::
   968 		file = TIOOpenFromLock(TIOBase, lock)
   969 		TAPTR                  TAPTR    TAPTR
   970 
   971 		file = TOpenFromLock(lock)
   972 		TAPTR                TAPTR
   973 
   974 FUNCTION::
   975 	This function turns a lock to a file into an open file
   976 	handle. The lock will be absorbed by the newly created
   977 	filehandle, and is no longer usable. If this function
   978 	fails, the lock is still valid. In case of failure, use
   979 	TGetIOErr() for error diagnostics.
   980 
   981 INPUTS::
   982 	- {{lock}} - Lock handle to turn into a file
   983 
   984 RESULTS::
   985 	- {{file}} - Newly opened file handle
   986 
   987 SEE ALSO::
   988 	TLockFile(), TOpenFile()
   989 
   990 =={ TAddPart }==
   991 
   992 NAME::
   993 	TAddPart - Add a path component to a path
   994 
   995 SYNOPSIS::
   996 		len = TIOAddPart(TIOBase, path,   part,   buf,    buflen)
   997 		TINT             TAPTR    TSTRPTR TSTRPTR TSTRPTR TINT
   998 
   999 		len = TAddPart(path,   part,   buf,    buflen)
  1000 		TINT           TSTRPTR TSTRPTR TSTRPTR TINT
  1001 
  1002 FUNCTION::
  1003 	Taking into account all possible path delimiters, add a part
  1004 	to a path, and render the resulting string to the destination
  1005 	specified throughout buf and buflen. If buf is TNULL and buflen
  1006 	zero, only the length will be calculated. Either way, the
  1007 	actual or expected length of the resulting string will be
  1008 	returned, or -1 if an error occured. Note that the length of
  1009 	the destination buffer is expected to include an extra byte
  1010 	for the string's trailing zero.
  1011 
  1012 INPUTS::
  1013 	- {{path}} - First path component
  1014 	- {{part}} - Second path component
  1015 	- {{buf}} - Destination buffer, or TNULL
  1016 	- {{buflen}} - Length of destination buffer, or zero
  1017 
  1018 RESULTS::
  1019 	- {{len}} - Length of the resulting string, or -1 if an error occured
  1020 
  1021 SEE ALSO::
  1022 	TNameOf()
  1023 
  1024 =={ TRename }==
  1025 
  1026 NAME::
  1027 	TRename - Rename a file or directory.
  1028 
  1029 SYNOPSIS::
  1030 		success = TIORename(TIOBase, oldname, newname)
  1031 		TINT                TAPTR    TSTRPTR  TSTRPTR
  1032 
  1033 		success = TRename(oldname, newname)
  1034 		TINT              TSTRPTR  TSTRPTR
  1035 
  1036 FUNCTION::
  1037 	This function tries to rename the file or directory specified
  1038 	throughout oldname to newname. If an object of the new name
  1039 	already exists then an error is returned. Both oldname and
  1040 	newname can contain path parts, in which case the object will
  1041 	be moved across directories. Attempts to rename an object across
  1042 	different filesystems will fail, and the result will be TFALSE.
  1043 
  1044 INPUTS::
  1045 	- {{oldname}} - Old name of an object
  1046 	- {{newname}} - New name for the object
  1047 
  1048 RESULTS::
  1049 	- {{success}} - boolean
  1050 
  1051 SEE ALSO::
  1052 	TMakeDir(), TDeleteFile()
  1053 
  1054 =={ TMakeDir }==
  1055 
  1056 NAME::
  1057 	TMakeDir - Create a new directory
  1058 
  1059 SYNOPSIS::
  1060 		lock = TIOMakeDir(TIOBase, name,   tags)
  1061 		TAPTR             TAPTR    TSTRPTR TTAGITEM*
  1062 
  1063 		lock = TMakeDir(name,   tags)
  1064 		TAPTR           TSTRPTR TTAGITEM*
  1065 
  1066 FUNCTION::
  1067 	Attempt to create a new directory of the given name. If
  1068 	successful, a shared lock to the newly created directory
  1069 	will be returned. Otherwise, the return value will be
  1070 	TNULL, and a secondary error code is available by calling
  1071 	TGetIOErr().
  1072 
  1073 INPUTS::
  1074 	- {{name}} - Name of the directory to create
  1075 	- {{tags}} - Pointer to an array of tagitems
  1076 
  1077 RESULTS::
  1078 	- {{lock}} - Shared lock to newly created directory, or TNULL
  1079 
  1080 SEE ALSO::
  1081 	TLockFile(), TUnlockFile(), TRename(), TDeleteFile()
  1082 
  1083 =={ TDeleteFile }==
  1084 
  1085 NAME::
  1086 	TDeleteFile - Delete an object
  1087 
  1088 SYNOPSIS::
  1089 		success = TIODeleteFile(TIOBase, name)
  1090 		TBOOL                   TAPTR    TSTRPTR
  1091 
  1092 		success = TDeleteFile(name)
  1093 		TBOOL                 TSTRPTR
  1094 
  1095 FUNCTION::
  1096 	This function deletes the object of the specified name.
  1097 	If the addressed object is a directory, it must be empty
  1098 	for this function to succeed.
  1099 
  1100 INPUTS::
  1101 	- {{name}} - Name of the object to delete
  1102 
  1103 RESULTS::
  1104 	- {{success}} - Boolean
  1105 
  1106 SEE ALSO::
  1107 	TRename(), TMakeDir()
  1108 
  1109 =={ TSetIOErr }==
  1110 
  1111 NAME::
  1112 	TSetIOErr - Set I/O error code
  1113 
  1114 SYNOPSIS::
  1115 		olderror = TIOSetIOErr(TIOBase, newerror)
  1116 		TINT                   TAPTR    TINT
  1117 
  1118 		olderror = TSetIOErr(newerror)
  1119 		TINT                 TINT
  1120 
  1121 FUNCTION::
  1122 	This function sets the I/O error code in the caller's task
  1123 	context to the value specified as newerror. The previous
  1124 	error code is returned to the caller.
  1125 
  1126 INPUTS::
  1127 	- {{newerror}} - New error code in the current task
  1128 
  1129 RESULTS::
  1130 	- {{olderror}} - Last error code in the current task
  1131 
  1132 SEE ALSO::
  1133 	TGetIOErr(), TFault()
  1134 
  1135 =={ TGetIOErr }==
  1136 
  1137 NAME::
  1138 	TGetIOErr - Get last I/O error code
  1139 
  1140 SYNOPSIS::
  1141 		error = TIOGetIOErr(TIOBase)
  1142 		TINT                TAPTR
  1143 
  1144 		error = TGetIOErr()
  1145 		TINT
  1146 
  1147 FUNCTION::
  1148 	Most I/O functions set a secondary error condition in the
  1149 	caller's task context in case of a problem. Use this function
  1150 	to query it. Error codes are defined in tek/mod/io.h, and can
  1151 	be translated to plain English using TFault().
  1152 
  1153 	Most functions reset the task's current error condition to
  1154 	zero on success, but this may not be true for all functions.
  1155 	To be sure, call TGetIOErr() only when a function's primary
  1156 	return value indicates a problem, or use TSetIOErr() to
  1157 	set it beforehand.
  1158 
  1159 RESULTS::
  1160 	- {{error}} - Secondary error code set by the last I/O function
  1161 
  1162 SEE ALSO::
  1163 	TSetIOErr(), TFault()
  1164 
  1165 =={ TFault }==
  1166 
  1167 NAME::
  1168 	TFault - Return text representation of an error
  1169 
  1170 SYNOPSIS::
  1171 		len = TIOFault(TIOBase, code, buf,    buflen, tags)
  1172 		TINT           TAPTR    TINT  TSTRPTR TINT    TTAGITEM*
  1173 
  1174 		len = TFault(code, buf,    buflen, tags)
  1175 		TINT         TINT  TSTRPTR TINT    TTAGITEM*
  1176 
  1177 FUNCTION::
  1178 	This function writes a text representation of an error code
  1179 	into a buffer specfified throughout buf and buflen. If the
  1180 	buffer arguments are TNULL respective zero, only the length
  1181 	of the string will be calculated and returned to the caller.
  1182 	Note that buflen is expected to include an extra byte for
  1183 	the string's trailing zero.
  1184 
  1185 	By convention, error messages should be no longer than
  1186 	79+1 characters (and preferrably much shorter).
  1187 
  1188 INPUTS::
  1189 	- {{code}} - Error code
  1190 	- {{buf}} - Destination buffer, or TNULL
  1191 	- {{buflen}} - Length of the buffer, or zero
  1192 	- {{tags}} - reserved for future extensions
  1193 
  1194 RESULTS::
  1195 	- {{len}} - Length of the error string, or -1 in case of an error
  1196 
  1197 SEE ALSO::
  1198 	TGetIOErr(), TSetIOErr()
  1199 
  1200 =={ TAssignLate }==
  1201 
  1202 NAME::
  1203 	TAssignLate - Add a late-binding assign
  1204 
  1205 SYNOPSIS::
  1206 		success = TIOAssignLate(TIOBase, devname, pathname)
  1207 		TBOOL                   TAPTR    TSTRPTR  TSTRPTR
  1208 
  1209 		success = TAssignLate(devname, pathname)
  1210 		TBOOL                 TSTRPTR  TSTRPTR
  1211 
  1212 FUNCTION::
  1213 	This function assigns a logical device name to the specified
  1214 	path. The device name must be without trailing colon. The
  1215 	assignment is late-binding, i.e. the assign is stored
  1216 	symbolically, and resolved upon the first access to its name.
  1217 
  1218 INPUTS::
  1219 	- {{devname}} - Name of the logical device, without colon
  1220 	- {{pathname}} - A fully qulified TEKlib path
  1221 
  1222 RESULTS::
  1223 	- {{success}} - Boolean
  1224 
  1225 NOTES::
  1226 	It is currently not possible to remove a late-binding assign
  1227 	from the namespace. If you want to be able to remove an assign,
  1228 	use TAssignLock() instead.
  1229 
  1230 SEE ALSO::
  1231 	TAssignLock(), TGetIOErr()
  1232 
  1233 =={ TAssignLock }==
  1234 
  1235 NAME::
  1236 	TAssignLock - Add an assignment to the namespace
  1237 
  1238 SYNOPSIS::
  1239 		success = TIOAssignLock(TIOBase, devname, lock)
  1240 		TBOOL                   TAPTR    TSTRPTR  TAPTR
  1241 
  1242 		success = TAssignLock(devname, lock)
  1243 		TBOOL                 TSTRPTR  TAPTR
  1244 
  1245 FUNCTION::
  1246 	This function assigns a logical device name to the specified
  1247 	lock. The device name must be without trailing colon. Passing
  1248 	TNULL for the lock cancels outstanding assigns to that name.
  1249 
  1250 	Note that if this function succeeds, the lock will be absorbed
  1251 	by the I/O module's internal device list, and is no longer
  1252 	valid. If you need to keep a copy of the lock, pass a duplicate
  1253 	created with TDupLock().
  1254 
  1255 INPUTS::
  1256 	- {{devname}} - Name of the logical device, without colon
  1257 	- {{lock}} - A lock to be associated
  1258 
  1259 RESULTS::
  1260 	- {{success}} - Boolean
  1261 
  1262 SEE ALSO::
  1263 	TAssignLate(), TGetIOErr()
  1264 
  1265 =={ TObtainPacket }==
  1266 
  1267 NAME::
  1268 	TObtainPacket - Obtain an I/O handler packet
  1269 
  1270 SYNOPSIS::
  1271 		iomsg = TIOObtainPacket(TIOBase, name,   namepart)
  1272 		TIOMSG*                 TAPTR    TSTRPTR TSTRPTR*
  1273 
  1274 		iomsg = TObtainPacket(name,   namepart)
  1275 		TIOMSG*               TSTRPTR TSTRPTR*
  1276 
  1277 FUNCTION::
  1278 	Resolve the specified name and obtain an I/O handler message (or
  1279 	''packet'') from the corresponding handler. A pointer to the
  1280 	handler-independent part of the name will be returned in the
  1281 	variable being pointed to by namepart.
  1282 
  1283 	"foo:bar" would try to obtain the I/O message from the handler
  1284 	responsible for "foo", and return a pointer to "bar" via the
  1285 	variable being pointed to by namepart.
  1286 
  1287 	"foo/bar" would try to compose the full name from the current
  1288 	task's current directory. If present, the resulting I/O message
  1289 	will be obtained from the handler on which the current directory
  1290 	resides, and the name part would possibly result in something
  1291 	like "home/paul/foo/bar".
  1292 
  1293 	If no lock on a current directory is present in the current task
  1294 	context then a lock on an application's current directory will be
  1295 	attempted from the default I/O handler.
  1296 
  1297 	The I/O message can be used by implementors of direct handler
  1298 	communications, such as for asynchronous I/O (overlapping
  1299 	reads and writes), etc. After filling in fields appropriately,
  1300 	the packet can be sent to its handler with exec:TPutIO().
  1301 
  1302 	See also tek/mod/ioext.h for the I/O message structure and
  1303 	action types.
  1304 
  1305 INPUTS::
  1306 	- {{name}} - Path/file name
  1307 	- {{namepart}} - Pointer to a string variable
  1308 
  1309 	The string variable receives a pointer to the handler-independent
  1310 	part of the name.
  1311 
  1312 RESULTS::
  1313 	- {{iomsg}} - An I/O message ready for usage, or TNULL
  1314 
  1315 	TNULL will be returned if no handler can resolve the requested
  1316 	name.
  1317 
  1318 SEE ALSO::
  1319 	TReleasePacket(), exec:TPutIO()
  1320 
  1321 =={ TReleasePacket }==
  1322 
  1323 NAME::
  1324 	TReleasePacket - Release an I/O message
  1325 
  1326 SYNOPSIS::
  1327 		TIOReleasePacket(TIOBase, iomsg)
  1328 		                 TAPTR    TIOMSG*
  1329 
  1330 		TReleasePacket(iomsg)
  1331 		               TIOMSG*
  1332 
  1333 FUNCTION::
  1334 	Free an I/O message allocated with TObtainPacket(). When the
  1335 	last outstanding I/O message is returned to its handler, the
  1336 	handler will usually close down and free its resources. All
  1337 	messages obtained for direct communication with handlers must
  1338 	be freed using this function.
  1339 
  1340 INPUTS::
  1341 	- {{iomsg}} - I/O message allocated with TObtainPacket()
  1342 
  1343 SEE ALSO::
  1344 	TObtainPacket()
  1345 
  1346 =={ TMakeName }==
  1347 
  1348 NAME::
  1349 	TMakeName - Make a path/file name
  1350 
  1351 SYNOPSIS::
  1352 		len = TIOMakeName(TIOBase, name,   dest,   dlen, mode, tags)
  1353 		TINT              TAPTR    TSTRPTR TSTRPTR TINT  TINT  TTAGITEM*
  1354 
  1355 		len = TMakeName(name,   dest,   dlen, mode, tags)
  1356 		TINT            TSTRPTR TSTRPTR TINT  TINT  TTAGITEM*
  1357 
  1358 FUNCTION::
  1359 	This function tries to convert the specified name to a
  1360 	fully-qualified, absolute path/file name, and renders the
  1361 	result to the destination buffer. The length specified with dlen
  1362 	is assumed to include an extra byte for the string's trailing
  1363 	zero byte.
  1364 
  1365 	If dest is TNULL and dlen zero, only the length of the resulting
  1366 	string will be calculated and returned to the caller. In case
  1367 	of failure, the return value is -1.
  1368 
  1369 	The mode argument determines the type of conversion.
  1370 	Currently defined:
  1371 
  1372 	TPPF_HOST2TEK
  1373 		Tries to convert a path or component in host-style
  1374 		naming conventions to a fully-qualified path/name
  1375 		in TEKlib's naming conventions. In this mode, the
  1376 		name resolution request will be sent to the handler
  1377 		responsible for the current task's current directory.
  1378 
  1379 	TPPF_TEK2HOST
  1380 		Tries to convert a path or component in TEKlib-style
  1381 		naming conventions to a fully-qualified path/name
  1382 		in the host's naming conventions. If an absolute path
  1383 		was specified, the name resolution request will be sent
  1384 		to the respective handler. If a relative name was given,
  1385 		the request will be sent to the handler responsible for
  1386 		the current task's current directory.
  1387 
  1388 	An error is returned if the addressed handler does not support
  1389 	the name resolution action.
  1390 
  1391 INPUTS::
  1392 	- {{name}} - Path/file or component name to be converted
  1393 	- {{dest}} - Destination buffer, or TNULL
  1394 	- {{dlen}} - Length of destination buffer, or 0
  1395 	- {{mode}} - Conversion mode
  1396 	- {{tags}} - Pointer to an array of tag items
  1397 
  1398 TAGS::
  1399 	None currently defined.
  1400 
  1401 RESULTS::
  1402 	- {{len}} - Length of the resulting string, or -1 in case of an error
  1403 
  1404 	In case of an error, use TGetIOErr() for getting extended error
  1405 	information.
  1406 
  1407 SEE ALSO::
  1408 	TNameOf(), TAddPart()
  1409 
  1410 =={ TMount }==
  1411 
  1412 NAME::
  1413 	TMount - Mount a named device
  1414 
  1415 SYNOPSIS::
  1416 		success = TIOMount(TIOBase, devname, action, tags)
  1417 		TBOOL              TAPTR    TSTRPTR  TINT    TTAGITEM*
  1418 
  1419 		success = TMount(devname, action, tags)
  1420 		TBOOL            TSTRPTR  TINT    TTAGITEM*
  1421 
  1422 FUNCTION::
  1423 	This function attempts to mount or unmount the device name
  1424 	specified. Actions currently defined:
  1425 
  1426 	TIOMNT_ADD
  1427 		If successful, an instance of a device or
  1428 		filesystem handler is loaded, initialized,
  1429 		and bound to the name. Fails if the name
  1430 		is already in use.
  1431 
  1432 	TIOMNT_REMOVE
  1433 		Tries to unmount the given name. Fails if no
  1434 		device of the given name is mounted.
  1435 
  1436 INPUTS::
  1437 	- {{devname}} - Name of the device, without trailing {{:}}
  1438 	- {{action}} - Action code
  1439 	- {{tags}} - Pointer to an array of tag items
  1440 
  1441 TAGS::
  1442 	The tags argument usually contains startup arguments and will
  1443 	be passed to the handler's instance open function. These tags
  1444 	will be interpreted by TMount():
  1445 
  1446 	TIOMount_Handler, (TSTRPTR)
  1447 		Name of the addressed handler.
  1448 		Default: The same as devname
  1449 
  1450 	TIOMount_HndVersion, (TUINT16)
  1451 		Minimum version of the handler to be loaded.
  1452 		Default: 0 (any version will suffice)
  1453 
  1454 	All other tags will be forwarded directly to the handler's
  1455 	instance open function. Tags with a predefined meaning include
  1456 
  1457 	TIOMount_Device, (TSTRPTR)
  1458 		Name of an Exec lowlevel device
  1459 
  1460 	TIOMount_InitString, (TSTRPTR)
  1461 		Startup control arguments
  1462 
  1463 RESULTS::
  1464 	- {{success}} - Boolean
  1465 
  1466 	If this function fails, use TGetIOErr() for getting extended
  1467 	error information.
  1468 
  1469 SEE ALSO::
  1470 	TAssignLock(), TAssignLate(), TGetIOErr()
  1471 
  1472 =={ TFUngetC }==
  1473 
  1474 NAME::
  1475 	TFUngetC - Put back one character to a buffered file
  1476 
  1477 SYNOPSIS::
  1478 		pushedchar = TIOFUngetC(TIOBase, file, character)
  1479 		TINT                    TAPTR    TAPTR TINT
  1480 
  1481 		pushedchat = TIOFUngetC(file, character)
  1482 		TINT                    TAPTR TINT
  1483 
  1484 FUNCTION::
  1485 	Push back one character to a buffered file, where it will be available
  1486 	for subsequent reads. Only one pushback is guaranteed to succeed.
  1487 	Passing -1 for the character will cause the last character read to be
  1488 	pushed back. If the last character read was TEOF, the next character
  1489 	read will be TEOF.
  1490 
  1491 	The return value will be the character that was pushed back, or -1
  1492 	(TEOF) if an error occured, or when the last character read was TEOF.
  1493 
  1494 INPUTS::
  1495 	- {{file}} - Filehandle
  1496 	- {{character}} - Chracter to push back, or -1
  1497 
  1498 RESULTS::
  1499 	- {{pushedchar}} - Character pushed back, or -1 if it cannot be pushed back
  1500 
  1501 SEE ALSO::
  1502 	TFGetC(), TFlush(), TFPutC(), TRead(), TOpenFile()
  1503 
  1504 =={ TFGetS }==
  1505 
  1506 NAME::
  1507 	TFGetS - Read a line from a file, buffered
  1508 
  1509 SYNOPSIS::
  1510 		line = TIOFGetS(TIOBase, file, buffer, len)
  1511 		TSTRPTR         TAPTR    TAPTR TSTRPTR TINT
  1512 
  1513 		line = TFGetS(file, buffer, len)
  1514 		TSTRPTR       TAPTR TSTRPTR TINT
  1515 
  1516 FUNCTION::
  1517 	Read a single line from the specified file, stopping at either TEOF
  1518 	or a newline character. Up to len minus one characters are written
  1519 	from the input to the specified buffer. If a newline is read, it is
  1520 	stored in the buffer. In either case, the resulting string in the
  1521 	buffer will be terminated with a null byte. The return value will be
  1522 	set to buffer if successful, or TNULL if an error occured.
  1523 
  1524 INPUTS::
  1525 	- {{file}} - Filehandle
  1526 	- {{buffer}} - Pointer to a buffer
  1527 	- {{len}} - Size of the buffer [bytes]
  1528 
  1529 RESULTS::
  1530 	- {{line}} - will be set to buffer, or TNULL in case of an error
  1531 
  1532 SEE ALSO::
  1533 	TFPutS(), TFGetC(), TFPutC(), TRead(), TOpenFile()
  1534 
  1535 =={ TFPutS }==
  1536 
  1537 NAME::
  1538 	TFPutS - Write a string to a file, buffered
  1539 
  1540 SYNOPSIS::
  1541 		error = TIOFPutS(TIOBase, file, string)
  1542 		TINT             TAPTR    TAPTR TSTRPTR
  1543 
  1544 		error = TFPutS(file, string)
  1545 		TINT           TAPTR TSTRPTR
  1546 
  1547 FUNCTION::
  1548 	Write a null-terminated string to a file in a buffered operation;
  1549 	neither a newline nor a null byte is appended to the data written
  1550 	to the filehandle.
  1551 
  1552 INPUTS::
  1553 	- {{file}} - Filehandle
  1554 	- {{string}} - Pointer to a null-terminated string
  1555 
  1556 RESULTS::
  1557 	- {{error}} - number of bytes written if successful, TEOF on error
  1558 
  1559 SEE ALSO::
  1560 	TFPutS(), TFGetC(), TFPutC(), TRead(), TOpenFile()
  1561 
  1562 =={ TInputFH }==
  1563 
  1564 NAME::
  1565 	TInputFH - Get a task's standard input file handle
  1566 
  1567 SYNOPSIS::
  1568 		inputfh = TIOInputFH(TIOBase)
  1569 		TAPTR                TAPTR
  1570 
  1571 		inputfh = TInputFH()
  1572 		TAPTR              void
  1573 
  1574 FUNCTION::
  1575 	Get current task's standard input file handle. If the task
  1576 	in which the caller is running has no standard input handle,
  1577 	it is attempted to create one by opening a device named
  1578 	"stdio:in".
  1579 
  1580 	Note that under no circumstance the caller may close the
  1581 	resulting filehandle, as it is internally maintained with the
  1582 	task and getting closed when the task exits.
  1583 
  1584 RESULTS::
  1585 	- {{inputfh}} - current task's input file handle
  1586 
  1587 SEE ALSO::
  1588 	TOutputFH(), TErrorFH()
  1589 
  1590 =={ TOutputFH }==
  1591 
  1592 NAME::
  1593 	TOutputFH - Get a task's standard output file handle
  1594 
  1595 SYNOPSIS::
  1596 		outputfh = TIOOutputFH(TIOBase)
  1597 		TAPTR                  TAPTR
  1598 
  1599 		outputfh = TOutputFH()
  1600 		TAPTR                void
  1601 
  1602 FUNCTION::
  1603 	Get current task's standard output file handle. If the task
  1604 	in which the caller is running has no standard output handle,
  1605 	it is attempted to create one by opening a device named
  1606 	"stdio:out".
  1607 
  1608 	Note that under no circumstance the caller may close the
  1609 	resulting filehandle, as it is internally maintained with the
  1610 	task and getting closed when the task exits.
  1611 
  1612 RESULTS::
  1613 	- {{outputfh}} - current task's output file handle
  1614 
  1615 SEE ALSO::
  1616 	TInputFH(), TErrorFH()
  1617 
  1618 =={ TErrorFH }==
  1619 
  1620 NAME::
  1621 	TErrorFH - Get a task's standard error file handle
  1622 
  1623 SYNOPSIS::
  1624 		errorfh = TIOErrorFH(TIOBase)
  1625 		TAPTR                TAPTR
  1626 
  1627 		errorfh = TErrorFH()
  1628 		TAPTR              void
  1629 
  1630 FUNCTION::
  1631 	Get current task's standard error file handle. If the task
  1632 	in which the caller is running has no standard error handle,
  1633 	it is attempted to create one by opening a device named
  1634 	"stdio:err".
  1635 
  1636 	Note that under no circumstance the caller may close the
  1637 	resulting filehandle, as it is internally maintained with the
  1638 	task and getting closed when the task exits.
  1639 
  1640 RESULTS::
  1641 	- {{errorfh}} - current task's error file handle
  1642 
  1643 SEE ALSO::
  1644 	TInputFH(), TOutputFH()
  1645 
  1646 =={ TSetFileDate }==
  1647 
  1648 NAME::
  1649 	TSetFileDate - Set date of a filesystem object
  1650 
  1651 SYNOPSIS::
  1652 		success = TIOSetFileDate(TIOBase, name,   date,  tags)
  1653 		TBOOL                    TAPTR    TSTRPTR TDATE* TTAGITEM*
  1654 
  1655 		success = TSetFileDate(name,   date,  tags)
  1656 		TBOOL                  TSTRPTR TDATE* TTAGITEM*
  1657 
  1658 FUNCTION::
  1659 	This functions sets the date of the specified filesystem
  1660 	object. The return value will be TTRUE if the operation
  1661 	succeeded, otherwise TFALSE. Additional error diagnostics
  1662 	can be obtained with TGetIOErr().
  1663 
  1664 INPUTS::
  1665 	- {{name}} - Name of the object to modify
  1666 
  1667 RESULTS::
  1668 	- {{success}} - Boolean
  1669 
  1670 SEE ALSO::
  1671 	TExamine(), time:TMakeDate()
  1672