aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/find/function.c
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1997-10-13 21:06:22 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1997-10-13 21:06:22 +0000
commit3f5223f84ac91b218fb0544edf5e914e339023b3 (patch)
tree98a156ee3de2ddae62582219d2833a789c471b98 /usr.bin/find/function.c
parent6ab2db5e53afa7055c6eeca5701a2be652ab2c6c (diff)
Notes
Diffstat (limited to 'usr.bin/find/function.c')
-rw-r--r--usr.bin/find/function.c98
1 files changed, 98 insertions, 0 deletions
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 46f3771b36e0..7c552ef0462f 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -126,6 +126,38 @@ find_parsenum(plan, option, vp, endch)
++((p)->t_data);
/*
+ * -amin n functions --
+ *
+ * True if the difference between the file access time and the
+ * current time is n min periods.
+ */
+int
+f_amin(plan, entry)
+ PLAN *plan;
+ FTSENT *entry;
+{
+ extern time_t now;
+
+ COMPARE((now - entry->fts_statp->st_atime +
+ 60 - 1) / 60, plan->t_data);
+}
+
+PLAN *
+c_amin(arg)
+ char *arg;
+{
+ PLAN *new;
+
+ ftsoptions &= ~FTS_NOSTAT;
+
+ new = palloc(N_AMIN, f_amin);
+ new->t_data = find_parsenum(new, "-amin", arg, NULL);
+ TIME_CORRECT(new, N_AMIN);
+ return (new);
+}
+
+
+/*
* -atime n functions --
*
* True if the difference between the file access time and the
@@ -155,6 +187,39 @@ c_atime(arg)
TIME_CORRECT(new, N_ATIME);
return (new);
}
+
+
+/*
+ * -cmin n functions --
+ *
+ * True if the difference between the last change of file
+ * status information and the current time is n min periods.
+ */
+int
+f_cmin(plan, entry)
+ PLAN *plan;
+ FTSENT *entry;
+{
+ extern time_t now;
+
+ COMPARE((now - entry->fts_statp->st_ctime +
+ 60 - 1) / 60, plan->t_data);
+}
+
+PLAN *
+c_cmin(arg)
+ char *arg;
+{
+ PLAN *new;
+
+ ftsoptions &= ~FTS_NOSTAT;
+
+ new = palloc(N_CMIN, f_cmin);
+ new->t_data = find_parsenum(new, "-cmin", arg, NULL);
+ TIME_CORRECT(new, N_CMIN);
+ return (new);
+}
+
/*
* -ctime n functions --
*
@@ -186,6 +251,7 @@ c_ctime(arg)
return (new);
}
+
/*
* -depth functions --
*
@@ -678,6 +744,38 @@ c_mtime(arg)
}
/*
+ * -mmin n functions --
+ *
+ * True if the difference between the file modification time and the
+ * current time is n min periods.
+ */
+int
+f_mmin(plan, entry)
+ PLAN *plan;
+ FTSENT *entry;
+{
+ extern time_t now;
+
+ COMPARE((now - entry->fts_statp->st_mtime + 60 - 1) /
+ 60, plan->t_data);
+}
+
+PLAN *
+c_mmin(arg)
+ char *arg;
+{
+ PLAN *new;
+
+ ftsoptions &= ~FTS_NOSTAT;
+
+ new = palloc(N_MMIN, f_mmin);
+ new->t_data = find_parsenum(new, "-mmin", arg, NULL);
+ TIME_CORRECT(new, N_MMIN);
+ return (new);
+}
+
+
+/*
* -name functions --
*
* True if the basename of the filename being examined