ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/extfs_unix.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/extfs_unix.cpp (file contents):
Revision 1.7 by cebix, 1999-11-08T16:43:11Z vs.
Revision 1.8 by cebix, 1999-11-08T17:00:13Z

# Line 368 | Line 368 | size_t extfs_write(int fd, void *buffer,
368          errno = 0;
369          return write(fd, buffer, length);
370   }
371 +
372 +
373 + /*
374 + *  Remove file/directory (and associated helper files),
375 + *  returns false on error (and sets errno)
376 + */
377 +
378 + bool extfs_remove(const char *path)
379 + {
380 +        // Remove helpers first, don't complain if this fails
381 +        char helper_path[MAX_PATH_LENGTH];
382 +        make_helper_path(path, helper_path, ".finf/", false);
383 +        remove(helper_path);
384 +        make_helper_path(path, helper_path, ".rsrc/", false);
385 +        remove(helper_path);
386 +
387 +        // Now remove file or directory
388 +        if (remove(path) < 0) {
389 +                if (errno == EISDIR)
390 +                        return rmdir(path) == 0;
391 +                else
392 +                        return false;
393 +        }
394 +        return true;
395 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines