refactor(maiboyer): adding the maibaoyer directory
This commit is contained in:
parent
db7f1343c5
commit
ab55d4de10
48 changed files with 0 additions and 0 deletions
|
|
@ -1,20 +0,0 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "%s: <file> <target>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
const char *file = argv[1];
|
||||
const char *target = argv[2];
|
||||
int fd = -1;
|
||||
while (1) {
|
||||
unlink(file);
|
||||
fd = open(file, O_CREAT | O_RDWR | O_TRUNC, 0777);
|
||||
close(fd);
|
||||
unlink(file);
|
||||
symlink(target, file);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue