new utilities.
the .C files compile but are renamed to avoid building automatically.
This commit is contained in:
parent
f08fdedcee
commit
bc7cb1a15a
45 changed files with 16585 additions and 0 deletions
26
src/cmd/mkdir.C
Normal file
26
src/cmd/mkdir.C
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
|
||||
void
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int i, f;
|
||||
char *e;
|
||||
|
||||
e = nil;
|
||||
for(i=1; i<argc; i++){
|
||||
if(access(argv[i], 0) == AEXIST){
|
||||
fprint(2, "mkdir: %s already exists\n", argv[i]);
|
||||
e = "error";
|
||||
continue;
|
||||
}
|
||||
f = create(argv[i], OREAD, DMDIR | 0777L);
|
||||
if(f < 0){
|
||||
fprint(2, "mkdir: can't create %s: %r\n", argv[i]);
|
||||
e = "error";
|
||||
continue;
|
||||
}
|
||||
close(f);
|
||||
}
|
||||
exits(e);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue