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

Comparing BasiliskII/src/AmigaOS/extfs_amiga.cpp (file contents):
Revision 1.2 by cebix, 1999-11-08T16:43:10Z vs.
Revision 1.3 by cebix, 1999-11-08T17:00:11Z

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines