wiki.icculus.org
[ front page | index | search | recent changes | git repo | offline html ]

PHYSFS_getLastErrorCode

Get machine-readable error information.

Header File

Defined in <physfs.h>

Syntax

PHYSFS_ErrorCode PHYSFS_getLastErrorCode(void);

Return Value

(PHYSFS_ErrorCode) Returns Enumeration value that represents last reported error.

Remarks

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.

Thread Safety

It is safe to call this function from any thread.

Version

This function is available since PhysicsFS 2.1.0.

See Also


CategoryAPI, CategoryAPIFunction, CategoryPhysicsFS


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.