Skip to content
Snippets Groups Projects
Commit 1d6dc5c6 authored by Andreas Dilger's avatar Andreas Dilger
Browse files

Add munlink tool which unlinks files without stat first (unlike GNU rm).

parent c0ab3403
No related branches found
No related tags found
No related merge requests found
...@@ -23,13 +23,15 @@ noinst_SCRIPTS = fs.sh intent-test.sh intent-test2.sh leak_finder.pl \ ...@@ -23,13 +23,15 @@ noinst_SCRIPTS = fs.sh intent-test.sh intent-test2.sh leak_finder.pl \
runtests runvmstat snaprun.sh runtests runvmstat snaprun.sh
pkglib_SCRIPTS = common.sh pkglib_SCRIPTS = common.sh
pkgcfg_DATA = lustre.cfg pkgcfg_DATA = lustre.cfg
noinst_PROGRAMS = openunlink testreq truncate directio openme writeme mcreate tchmod toexcl fsx #ldaptest noinst_PROGRAMS = openunlink testreq truncate directio openme writeme mcreate
noinst_PROGRAMS += munlink tchmod toexcl fsx #ldaptest
# ldaptest_SOURCES = ldaptest.c # ldaptest_SOURCES = ldaptest.c
tchmod_SOURCES = tchmod.c tchmod_SOURCES = tchmod.c
toexcl_SOURCES = toexcl.c toexcl_SOURCES = toexcl.c
testreq_SOURCES = testreq.c testreq_SOURCES = testreq.c
mcreate_SOURCES = mcreate.c mcreate_SOURCES = mcreate.c
munlink_SOURCES = munlink.c
truncate_SOURCES = truncate.c truncate_SOURCES = truncate.c
directio_SOURCES = directio.c directio_SOURCES = directio.c
openunlink_SOURCES = openunlink.c openunlink_SOURCES = openunlink.c
......
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char ** argv)
{
int rc;
if (argc < 2) {
printf("Usage %s filename\n", argv[0]);
return 1;
}
rc = unlink(argv[1]);
if (rc) {
printf("unlink(%s) error: %s\n", argv[1], strerror(errno));
}
return rc;
}
...@@ -12,7 +12,7 @@ export PATH=/sbin:/usr/sbin:$SRCDIR:$PATH ...@@ -12,7 +12,7 @@ export PATH=/sbin:/usr/sbin:$SRCDIR:$PATH
ERROR= ERROR=
SRC=/etc SRC=/etc
COUNT=1000 [ "$COUNT" ] || COUNT=1000
setup_opts $@ setup_opts $@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment