Function physfs_sys::PHYSFS_getLastErrorCode[][src]

pub unsafe extern "C" fn PHYSFS_getLastErrorCode() -> PHYSFS_ErrorCode
Expand description

\fn PHYSFS_ErrorCode PHYSFS_getLastErrorCode(void) \brief Get machine-readable error information.

Get the last PhysicsFS error message as an integer value. This will return PHYSFS_ERR_OK if there’s been no error since the last call to this function. Each thread has a unique error state associated with it, but each time a new error message is set, it will overwrite the previous one associated with that thread. It is safe to call this function at anytime, even before PHYSFS_init().

PHYSFS_getLastError() and PHYSFS_getLastErrorCode() both reset the same thread-specific error state. Calling one will wipe out the other’s data. If you need both, call PHYSFS_getLastErrorCode(), then pass that value to PHYSFS_getErrorByCode().

Generally, applications should only concern themselves with whether a given function failed; however, if you require more specifics, you can try this function to glean information, if there’s some specific problem you’re expecting and plan to handle. But with most things that involve file systems, the best course of action is usually to give up, report the problem to the user, and let them figure out what should be done about it. For that, you might prefer PHYSFS_getErrorByCode() instead.

\return Enumeration value that represents last reported error.

\sa PHYSFS_getErrorByCode