henesyinit from p9fce6d0435 years agoHistory
34 lines · 567 B · C
RawDownload
#include <u.h>#include <libc.h> voidmain(int argc, char **argv){	int fd, n, m;	char buf[1024], dir[512], *str; 	fd = open("/dev/acme/ctl", OWRITE);	if(fd < 0)		exits(0);	getwd(dir, 512);	strcpy(buf, "name ");	strcpy(buf+5, dir);	n = strlen(buf);	if(n>0 && buf[n-1]!='/')		buf[n++] = '/';	buf[n++] = '-';	if(argc > 1)		str = argv[1];	else		str = "rc";	m = strlen(str);	strcpy(buf+n, str);	n += m;	buf[n++] = '\n';	write(fd, buf, n);	strcpy(buf, "dumpdir ");	strcpy(buf+8, dir);	strcat(buf, "\n");	write(fd, buf, strlen(buf));	exits(0);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t