summaryrefslogtreecommitdiff
path: root/appl/tiny/rm.b
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 17:07:39 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 17:07:39 +0000
commit37da2899f40661e3e9631e497da8dc59b971cbd0 (patch)
treecbc6d4680e347d906f5fa7fca73214418741df72 /appl/tiny/rm.b
parent54bc8ff236ac10b3eaa928fd6bcfc0cdb2ba46ae (diff)
20060303a
Diffstat (limited to 'appl/tiny/rm.b')
-rw-r--r--appl/tiny/rm.b23
1 files changed, 23 insertions, 0 deletions
diff --git a/appl/tiny/rm.b b/appl/tiny/rm.b
new file mode 100644
index 00000000..81179869
--- /dev/null
+++ b/appl/tiny/rm.b
@@ -0,0 +1,23 @@
+implement Rm;
+
+include "sys.m";
+ sys: Sys;
+include "draw.m";
+
+Rm: module
+{
+ init: fn(ctxt: ref Draw->Context, argv: list of string);
+};
+
+init(nil: ref Draw->Context, argv: list of string)
+{
+ sys = load Sys Sys->PATH;
+ stderr := sys->fildes(2);
+
+ argv = tl argv;
+ while(argv != nil) {
+ if(sys->remove(hd argv) < 0)
+ sys->fprint(stderr, "rm: %s: %r\n", hd argv);
+ argv = tl argv;
+ }
+}