MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / File_ReadBlockFile_Ex

Function File_ReadBlockFile_Ex

src/file.c:881–890  ·  view source on GitHub ↗

* Reads length bytes from filename into buffer. * * @param filename Then name of the file to read. * @param buffer The buffer to read into. * @param length The amount of bytes to read. * @return The amount of bytes truly read, or 0 if there was a failure. */

Source from the content-addressed store, hash-verified

879 * @return The amount of bytes truly read, or 0 if there was a failure.
880 */
881uint32 File_ReadBlockFile_Ex(enum SearchDirectory dir, const char *filename, void *buffer, uint32 length)
882{
883 uint8 index;
884
885 index = File_Open_Ex(dir, filename, FILE_MODE_READ);
886 if (index == FILE_INVALID) return 0;
887 length = File_Read(index, buffer, length);
888 File_Close(index);
889 return length;
890}
891
892/**
893 * Reads the whole file in the memory.

Callers

nothing calls this directly

Calls 3

File_Open_ExFunction · 0.85
File_ReadFunction · 0.85
File_CloseFunction · 0.85

Tested by

no test coverage detected