Added a "symlink" command that can create symlinks from the shell (like "ln -s").
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@561 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ae372703ce
commit
28cdc245d3
|
@ -0,0 +1,3 @@
|
|||
SubDir OBOS_TOP src kernel apps symlink ;
|
||||
|
||||
KernelObjects <$(SOURCE_GRIST)>main.c : -fpic -Wno-unused ;
|
|
@ -0,0 +1,22 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 3) {
|
||||
fprintf(stderr, "usage: symlink <target> <link-name>\n");
|
||||
return -1;
|
||||
}
|
||||
if (symlink(argv[2], argv[1]) < 0) {
|
||||
fprintf(stderr, "symlink failed: %s\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue