Appendix A: System Routines — Files
577
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
FType
Declaration:
WORD
FType
(const char *
fileName
, char *
buf
)
Category(ies):
Files
Description:
Return the file type (max five bytes) for a file as a zero terminated string.
Return FS_OK if successful. If error return FS_ERROR or FS_BAD_NAME
(from
FOpen
). FS_ERROR is also returned if the file is opened
successfully but the type field is invalid. Note that this will always fail if the
given file is already opened for WRITE mode.
Inputs:
fileName
— String pointer to the name of the file to open.
buf
— Pointer to a buffer of at least five bytes in length.
Outputs:
FS_OK — Successful.
FS_ERROR or
FS_BAD_NAME
— Error.
buf
— If successful, contains the description field (max five
bytes including zero byte terminator).
Assumptions:
File must not be opened for WRITE mode.
Side Effects:
None
Availability:
On AMS 2.00 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also:
None
Example:
char buf[6];
FCreate("APPDATA", "DAT" );
if (FS_OK == FType("APPDATA", buf ))
Disp( buf ); /* Create succeeded, buf will contain "DAT" */