blob: 811798696c9076e2117a7fd147bb550dd56fa366 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}
}
|