* Open a file for reading/writing/appending. * * @param filename The name of the file to open. * @param mode The mode to open the file in. Bit 1 means reading, bit 2 means writing. * @return An index value refering to the opened file, or FILE_INVALID. */
| 664 | * @return An index value refering to the opened file, or FILE_INVALID. |
| 665 | */ |
| 666 | uint8 File_Open_Ex(enum SearchDirectory dir, const char *filename, uint8 mode) |
| 667 | { |
| 668 | uint8 res; |
| 669 | |
| 670 | res = _File_Open(dir, filename, mode); |
| 671 | |
| 672 | if (res == FILE_INVALID) { |
| 673 | if(dir == SEARCHDIR_PERSONAL_DATA_DIR) { |
| 674 | Warning("Unable to open file '%s'.\n", filename); |
| 675 | } else { |
| 676 | Error("Unable to open file '%s'.\n", filename); |
| 677 | exit(1); |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | return res; |
| 682 | } |
| 683 | |
| 684 | /** |
| 685 | * Close an opened file. |
no test coverage detected