diff --git a/file_io.cpp b/file_io.cpp index 6c0105b..ee886b0 100644 --- a/file_io.cpp +++ b/file_io.cpp @@ -46,7 +46,7 @@ void FileClose(fileTYPE *file) file->fd = -1; } -int FileOpenEx(fileTYPE *file, const char *name, int mode) +int FileOpenEx(fileTYPE *file, const char *name, int mode, char mute) { sprintf(full_path, "%s/%s", (mode == -1) ? "" : getRootDir(), name); @@ -60,7 +60,7 @@ int FileOpenEx(fileTYPE *file, const char *name, int mode) file->fd = (mode == -1) ? shm_open("/vtrd", O_CREAT | O_RDWR | O_TRUNC, 0777) : open(full_path, mode); if (file->fd <= 0) { - printf("FileOpenEx(open) File:%s, error: %d.\n", full_path, file->fd); + if(!mute) printf("FileOpenEx(open) File:%s, error: %d.\n", full_path, file->fd); file->fd = -1; return 0; } @@ -78,7 +78,7 @@ int FileOpenEx(fileTYPE *file, const char *name, int mode) int ret = fstat64(file->fd, &st); if (ret < 0) { - printf("FileOpenEx(fstat) File:%s, error: %d.\n", full_path, ret); + if (!mute) printf("FileOpenEx(fstat) File:%s, error: %d.\n", full_path, ret); FileClose(file); return 0; } @@ -92,9 +92,9 @@ int FileOpenEx(fileTYPE *file, const char *name, int mode) return 1; } -int FileOpen(fileTYPE *file, const char *name) +int FileOpen(fileTYPE *file, const char *name, char mute) { - return FileOpenEx(file, name, O_RDONLY); + return FileOpenEx(file, name, O_RDONLY, mute); } int FileNextSector(fileTYPE *file) diff --git a/file_io.h b/file_io.h index fc93f07..370d9b0 100644 --- a/file_io.h +++ b/file_io.h @@ -41,8 +41,8 @@ int getStorage(int from_setting); void setStorage(int dev); int isUSBMounted(); -int FileOpenEx(fileTYPE *file, const char *name, int mode); -int FileOpen(fileTYPE *file, const char *name); +int FileOpenEx(fileTYPE *file, const char *name, int mode, char mute = 0); +int FileOpen(fileTYPE *file, const char *name, char mute = 0); void FileClose(fileTYPE *file); int FileSeek(fileTYPE *file, __off64_t offset, int origin);