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

PHYSFS_readBytes

Read bytes from a PhysicsFS filehandle.

Header File

Defined in <physfs.h>

Syntax

PHYSFS_sint64 PHYSFS_readBytes(PHYSFS_File *handle, void *buffer, PHYSFS_uint64 len);

Function Parameters

PHYSFS_File * handle handle returned from PHYSFS_openRead().
void * buffer buffer of at least len bytes to store read data into.
PHYSFS_uint64 len number of bytes being read from handle.

Return Value

(PHYSFS_sint64) Returns number of bytes read. This may be less than len; this does not signify an error, necessarily (a short read may mean EOF). PHYSFS_getLastErrorCode() can shed light on the reason this might be < len, as can PHYSFS_eof(). -1 if complete failure.

Remarks

The file must be opened for reading.

Thread Safety

Multiple threads can not operate on the same PHYSFS_File at the same time, but they can safely operate on different ones simultaneously.

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.