| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 1.91

 

remove_dir

#include "sfldir.h"
int
remove_dir (
    const char *path)

Synopsis

remove a directory. Returns 0 if the directory could be removed; -1 if there was an error. Under MS-DOS and OpenVMS accepts a directory name in UNIX format, i.e. containing '/' delimiters. The directory must be empty to be removed.

Source Code - (sfldir.c)

{
#if (defined (__UNIX__) || defined (__VMS_XOPEN) || defined (__OS2__))
    /*  Check that directory exists                                          */
    if (!file is directory (path))
        return (-1);

    return (rmdir (path));

#elif (defined (MSDOS_FILESYSTEM))
    int
        feedback;
    char
        *copy_path;

    /*  Check that directory exists                                          */
    if (!file is directory (path))
        return (-1);

    copy_path = mem_strdup (path);
    if (copy_path)
      {
        strconvch (copy_path, '/', '\\');
        feedback = rmdir (copy_path);
        mem_strfree (&copy_path);
      }
    return (feedback);
#else
    return (-1);
#endif
}

| << | < | > | >> iMatix Copyright © 1996-98 iMatix