netatalk: nad_rmdir.c File Reference

netatalk 4.5.1
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
nad_rmdir.c File Reference
`#include <errno.h>`
`#include <limits.h>`
`#include <signal.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <unistd.h>`
`#include <bstrlib.h>`
`#include <atalk/adouble.h>`
`#include <atalk/cnid.h>`
`#include <atalk/directory.h>`
`#include <atalk/util.h>`
`#include <atalk/vfs.h>`
`#include <atalk/volume.h>`
`#include "nad.h"`

## Functions
static void | usage_rmdir (void)
static int | is_protected_dir (const char *path, const afpvol_t *vol)
| Check if path is the volume root or its parent.
static int | rmdir_with_cnid (const char *path, afpvol_t *vol)
| Remove a single empty directory with CNID and AppleDouble cleanup.
static int | do_rmdir (const char *path, afpvol_t *vol)
| Remove directory and optionally empty parent directories.
int | nad_rmdir (int argc, char *argv[], AFPObj *obj)

## Function Documentation

## ◆ do_rmdir()

int do_rmdir | ( | const char * | path,
|  | afpvol_t * | vol )
| static

Remove directory and optionally empty parent directories.

When pflag is set, removes empty parent directories working upward from the specified path, stopping at the volume root.

Parameters

  [in] | path | path of directory to remove
  [in] | vol | open AFP volume

Returns
  0 on success, 1 on error

## ◆ is_protected_dir()

int is_protected_dir | ( | const char * | path,
|  | const afpvol_t * | vol )
| static

Check if path is the volume root or its parent.

Returns
  1 if path is a protected directory, 0 otherwise

## ◆ nad_rmdir()

int nad_rmdir | ( | int | argc,
|  | char * | argv[],
|  | AFPObj * | obj )

## ◆ rmdir_with_cnid()

int rmdir_with_cnid | ( | const char * | path,
|  | afpvol_t * | vol )
| static

Remove a single empty directory with CNID and AppleDouble cleanup.

Parameters

  [in] | path | absolute path of directory to remove
  [in] | vol | open AFP volume

Returns
  0 on success, -1 on error

## ◆ usage_rmdir()

void usage_rmdir | ( | void |  | ) |
| static