osPfsChecker osPfsChecker (function)

Inspects and repairs the Controller Pak's file system


#include <ultra64.h>        /* os.h */
s32 osPfsChecker(OSPfs *pfs);


osPfsChecker inspects the file management area of the Controller Pak, where it manages the file notes address. If it finds a damaged area, it attempts a repair operation. If a repair operation is performed, the status bit of the OSPfs structure pointed to by pfs is set to PFS_CORRUPTED. When this is done, data will be lost in most cases.

The pfs file handle that points to the OSPfs is initialized by the osPfsInitPak function. See osPfsInitPak to determine how to create this handle.

Since osPfsInitPak calls osPfsChecker internally, the application programmer will not usually need to use the osPfsChecker function.

If this function (osPfsChecker) is called successfully, 0 is returned. If an error occurs, one of the following error codes will be returned:

Either the Controller Pak is not inserted into the specified Controller or the Controller is not properly connected. To determine which is the case, use osContStartQuery or osContGetQuery.

Data transfer to or from the Controller has failed. If a transfer error occurs, up to three tries will be done internally. Therefore, it is rather rare to see this error. If this error has returned, it is possible that either the Controller is not connected properly, or the Controller Pak or Controller Socket is damaged.

There is a problem in the file system's management area. If this error is returned, either the Controller Pak is not connected properly, or the Controller Pak itself is damaged.

See Also

osContInit, osContStartQuery, osContGetQuery, and osPfsInitPak

Revision History

1999/02/01 Completely revised
1999/04/30 Changed format