--- BasiliskII/src/BeOS/extfs_beos.cpp 1999/10/22 13:57:04 1.4 +++ BasiliskII/src/BeOS/extfs_beos.cpp 1999/11/08 18:05:59 1.8 @@ -75,14 +75,14 @@ void extfs_exit(void) * Add component to path name */ -void add_path_component(char *path, const char *component, int max_len) +void add_path_component(char *path, const char *component) { int l = strlen(path); - if (l < max_len-1 && path[l-1] != '/') { + if (l < MAX_PATH_LENGTH-1 && path[l-1] != '/') { path[l] = '/'; path[l+1] = 0; } - strncat(path, component, max_len-1); + strncat(path, component, MAX_PATH_LENGTH-1); } @@ -283,7 +283,7 @@ int open_rfork(const char *path, int fla // Open temporary file for resource fork char rname[L_tmpnam]; tmpnam(rname); - int rfd = open(rname, O_RDWR | O_CREAT | O_TRUNC, 0664); + int rfd = open(rname, O_RDWR | O_CREAT | O_TRUNC, 0666); if (rfd < 0) { close(fd); return -1; @@ -455,3 +455,29 @@ size_t extfs_write(int fd, void *buffer, } return actual; } + + +/* + * Remove file/directory, returns false on error (and sets errno) + */ + +bool extfs_remove(const char *path) +{ + if (remove(path) < 0) { + if (errno == EISDIR) + return rmdir(path) == 0; + else + return false; + } + return true; +} + + +/* + * Rename/move file/directory, returns false on error (and sets errno) + */ + +bool extfs_rename(const char *old_path, const char *new_path) +{ + return rename(old_path, new_path) == 0; +}