osPfsFileState.3p 1.85 KB
.TH osPfsFileState 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
osPfsFileState \- Get file status
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
s32 osPfsFileState(OSPfs \(**pfs, s32 file_no, OSPfsState \(**state);
.Op
\f1
.fi
.SH DESCRIPTION
.sp
The 
.I osPfsFileState
function obtains information about a file known by the file descriptor
.I file_no,
obtained from a successful
.I osPfsAllocateFile 
(3P) or
.I osPfsFindFile 
(3P) function call. 
.I state
is a pointer to a
.I OSPfsState
structure into which information is placed concerning the file.
The 
.I OSPfs
handle 
must be the handle returned from 
.I osPfsInit.
See
.IR osPfsInit 
(3P) for details on how to create this handle. 
.sp
The contents of the structure pointed to by
.I state
include the following members:
.sp
.nf
.ta 5 15
	typedef struct {
		u32     file_size;      /* file size in bytes */
		u32     game_code;
		u16     company_code;
		char    ext_name[4];
		char    game_name[16];
	}
.fi

.sp
A value of 0 is returned if the calls succeed, otherwise
one of the following error code is returned.
.PP
.nf
.ta 5 26 
	PFS_ERR_CONTRFAIL	The controller sends data at higher data
			transfer rate than the hardware handling 
			capability or the hardware CRC error 
			occurs.
.sp
	PFS_ERR_INVALID		Invalid parameter or the specified file
			does not exist. Application should change 
			parameter and then retry.
.sp
	PFS_ERR_NEW_PACK	CONTROLLER PAK has been changed to a
 			different one. Application needs to call 
			osPfsInit(3p) to initialize the new
			CONTROLLER PAK.
.sp
	PFS_ERR_INCONSISTENT	File system is corrupted. Application needs
			to call osPfsChecker(3P) to repair the file 
			system.

.fi
.SH "SEE ALSO"
osContInit (3P),
osPfsAllocateFile (3P),
osPfsChecker (3P),
osPfsFreeBlocks (3P),
osPfsInit (3P),
osPfsIsPlug (3P),
osPfsReSizeFile (3P),
osPfsReadWriteFile (3P),
osPfsSetLabel (3P)