mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 16:33:30 +00:00
[FileAccess] Return error codes from store_* methods.
This commit is contained in:
parent
56a7dba10b
commit
a4b17e7852
30 changed files with 279 additions and 138 deletions
|
|
@ -295,10 +295,10 @@ void FileAccessUnix::flush() {
|
|||
fflush(f);
|
||||
}
|
||||
|
||||
void FileAccessUnix::store_buffer(const uint8_t *p_src, uint64_t p_length) {
|
||||
ERR_FAIL_NULL_MSG(f, "File must be opened before use.");
|
||||
ERR_FAIL_COND(!p_src && p_length > 0);
|
||||
ERR_FAIL_COND(fwrite(p_src, 1, p_length, f) != p_length);
|
||||
bool FileAccessUnix::store_buffer(const uint8_t *p_src, uint64_t p_length) {
|
||||
ERR_FAIL_NULL_V_MSG(f, false, "File must be opened before use.");
|
||||
ERR_FAIL_COND_V(!p_src && p_length > 0, false);
|
||||
return fwrite(p_src, 1, p_length, f) == p_length;
|
||||
}
|
||||
|
||||
bool FileAccessUnix::file_exists(const String &p_path) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue