A
download rmfiles.h
Language: C
LOC: 8
Project Info
grub.org - Distributed Internet Crawler(grub)
Server: SourceForge
Type: cvs
...ge\g\grub\grub\client\util\
   alt_ftw.c
   alt_ftw.h
   bin_test_util.dsp
   clog.cpp
   clog.h
   ConfigFileInfo.h
   crc.h
   crc_32.c
   crc_32.cpp
   crc_32.h
   crc_test.c
   crc_test.cpp
   crc32.c
   crc32.h
   dbl_list.c
   dbl_list.h
   delay.cpp
   delay.h
   diagnose.h
   fc32.c
   file_data.c
   file_data.h
   getopt.c
   getopt.h
   grubconf.c
   grubconf.h
   GrubExp.cpp
   GrubExp.h
   Gui.cpp
   Gui.h
   intl.h
   lib_util.dsp
   lockfile.cpp
   lockfile.h
   Makefile.am
   parsecfg.c
   parsecfg.h
   platform.h
   rmfiles.c
   rmfiles.h
   ServerSettings.cpp
   ServerSettings.h
   sniptype.h
   StatusInterface.cpp
   StatusInterface.h
   strip_url.c
   strip_url.h
   test_util.cpp

#ifndef _RMFILES_H_
#define _RMFILES_H_

/* possible modes */
#define RMFILES_STOP_ON_FIRST_FAIL 0
#define RMFILES_CONT_ON_FAIL       1

/* error codes */
#define RMFILES_SUCCESS 0
#define RMFILES_FAILURE -1

/* rmfiles_byext()
 * Removes files from a given path that match certain extension, or more
 * correctly, files whose last characters of their names match the given
 * ones.  This function runs in two modes.  In the first mode, it will stop
 * its actions after the first failure to remove files.  In the second mode,
 * It will keep trying to remove even after a failure.  However, there is no
 * way of getting why the removal failed or how many files were successfully
 * removed.  This function is not reentrant.  Function exits successfully if
 * no files match.
 * Parameters:
 *   path -- the path to start removing from.  No subdirectories will be
 *           included.
 *   extension -- the last characters a file must match
 *   mode -- RMFILES_STOP_ON_FIRST_FAIL or zero for the first mode;
 *           RMFILES_CONT_ON_FAIL for the second mode
 * Returns:
 *   RMFILES_SUCCESS -- all files the matched were removed
 *   RMFILES_FAILURE -- in the first mode, failure to remove a file.
 *     You can check errno for more information.  In the second mode, one or
 *     more (possibly all) files failed to be removed.  Do not rely on errno
 *     for a reason.
 */
int rmfiles_byext( const char *path, const char *extension, int mode );

#endif  /* _RMFILES_H_ */

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us