File I/O and system functions (Mio)


Functions

DEPRECATED LIBEXPORT int MioClose (int handle)
DEPRECATED LIBEXPORT long MioGetOpenFileSize (int handle)
DEPRECATED LIBEXPORT INT32 MioGetStr (char *str, INT32 len, FILE *f)
DEPRECATED LIBEXPORT int MioOpen (const MIUNICODE *filename, const char *mode, FILE **fp=0, UINT32 flag=0)
DEPRECATED LIBEXPORT INT32 MioRead (int handle, void *data, INT32 size)
DEPRECATED LIBEXPORT INT32 MioSeek (int handle, INT32 offset, int type)
DEPRECATED LIBEXPORT INT32 MioWrite (int handle, const void *const data, INT32 size)

Function Documentation

DEPRECATED LIBEXPORT int MioClose ( int  handle  ) 

Close a file.

Deprecated:
Replaced by FILE_RAW::Close();
Parameters:
handle  Handle to open file

DEPRECATED LIBEXPORT long MioGetOpenFileSize ( int  handle  ) 

Get size of an open file.

Deprecated:
Replaced by FILE_RAW::GetSize();
Returns:
Size of open file.
Made long instead of INT32 intentionally. This function is needed because the Mac does not have a fstat().
Parameters:
handle  Open file descriptor

DEPRECATED LIBEXPORT INT32 MioGetStr ( char *  str,
INT32  len,
FILE *  f 
)

Read a string from a file created on ANY platform.

Deprecated:
Replaced by FILE_TEXT::ReadLine().
Returns:
Length read, error code or -1 if EOF.
This function reads a line of text file up to the 'newline' character or (len - 1), whichever is first. The 'newline' character is handled irregardless of the platform run on and the platform that created the text file. The 'newline' charact is NOT appended onto the string. If this function gets to the 'end of file', -1 is returned. The length of the string should be 'len + 1' for reading in the string and a place for the string terminator. This behavior is the same as fgets().
Parameters:
str  String to read into
len  Maximum length to read - 1
f  File handle

DEPRECATED LIBEXPORT int MioOpen ( const MIUNICODE filename,
const char *  mode,
FILE **  fp = 0,
UINT32  flag = 0 
)

Open an existing file.

Deprecated:
Replaced by FILE_RAW::Open() and FILE_TEXT::Open()
Return value depends on whether 'fp' is NULL. If it is, this function uses open() to open the file and determines open mode based on the mode string. The handle is in the return value. Acceptable modes are shown below:

Modes and equivalent: "r" Read-only "r+" Read-write "w" New file (no CR/LF translation) "wt" New file (with CR/LF translation)

If 'fp' is not NULL, fopen() is used to open the file and the return value is 0 if fopen was sucessful, otherwise an error is returned. The flag is called MioFLAG_NoBuildErrStr. MioOpen will not build an error string if this flag is specified. Used in FindErrStr() in geterrst.c.

Parameters:
filename  File to open
mode  fopen() type mode string
fp  File pointer RETURNED, can be NULL
flag  Flag

DEPRECATED LIBEXPORT INT32 MioRead ( int  handle,
void *  data,
INT32  size 
)

Read from an open file.

Deprecated:
Replaced by FILE_RAW::Read();
Returns:
"Size" or error code.
If less than number of requested bytes are read, EDiskReadErr will be returned.
Parameters:
handle  Handle from MioOpen()
data  Buffer to contain data read
size  Number of bytes to read

DEPRECATED LIBEXPORT INT32 MioSeek ( int  handle,
INT32  offset,
int  type 
)

Seek to a position within an open file.

Deprecated:
Replaced by FILE_RAW::Seek();
Returns:
New position in the file.
Parameters:
handle  Open file handle from MioOpen().
offset  Where to seek to
type  SEEK_CUR, SEEK_SET, SEEK_END

DEPRECATED LIBEXPORT INT32 MioWrite ( int  handle,
const void *const  data,
INT32  size 
)

Write to an open file.

Deprecated:
Replaced by FILE_RAW::Write();
Returns:
"Size" or error code.
If the OPSYS write() call writes less than requested, EDiskWriteErr will be returned.
Parameters:
handle  Handle from MioOpen()
data  The data to write from
size  The amount to write


Generated on Thu Apr 26 04:46:40 2007 for TNTsdk by  doxygen 1.5.2