New "symlink" command which can create a symbolic link on the file system.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7515 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-05-11 02:04:38 +00:00
parent 73b10c8f1e
commit 450843b48f
@@ -62,7 +62,6 @@ main(int argc, char **argv)
do_fsh();
if (sys_unmount(1, -1, "/myfs") != 0) {
printf("could not un-mount /myfs\n");
return 5;
@@ -1135,6 +1134,29 @@ do_rename(int argc, char **argv)
}
static void
do_symlink(int argc, char **argv)
{
char target[B_PATH_NAME_LENGTH];
char *source;
status_t status;
if (argc < 3) {
printf("usage: symlink <source> <target>\n");
return;
}
source = argv[1];
strcpy(target, "/myfs/");
strcpy(target + 6, argv[2]);
status = sys_symlink(1, source, -1, target);
if (status != B_OK)
printf("symlink failed with error: %s\n", strerror(status));
}
static void
do_sync(int argc, char **argv)
{
@@ -1501,6 +1523,7 @@ cmd_entry fsh_cmds[] =
{ "tracker", do_tracker, "starts a Tracker like background thread that will listen to fs updates" },
{ "cio", do_cio, "does a I/O speed test" },
{ "stattest", do_stattest, "does an \"early\"/\"late\" stat test for files that are created or deleted" },
{ "symlink", do_symlink, "creates the specified symlink on the device" },
// additional commands from the file system will be included here
# include "additional_commands.h"