📄 ln.c
字号:
#/* * ln target [ new name ] */struct ibuf { int inum; int iflags; char inl; char iuid; int isize; int iaddr[8]; char *ictime[2]; char *imtime[2]; int fill;};#define DIR 040000#define FMT 060000main(argc, argv)char **argv;{ static struct ibuf statb; register char *np; if (argc<2) { write(1, "Usage: ln target [ newname ]\n", 29); exit(1); } if (argc==2) { np = argv[1]; while(*np++); while (*--np!='/' && np>argv[1]); np++; argv[2] = np; } stat(argv[1], &statb); if ((statb.iflags&FMT) == DIR) { write(1, "No directory link\n", 18); exit(1); } if (link(argv[1], argv[2])<0) { write(1, "Can't link\n", 11); exit(1); } exit(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -