aboutsummaryrefslogtreecommitdiff
path: root/mpiosh
diff options
context:
space:
mode:
authorgermeier <germeier>2003-04-19 23:58:02 +0000
committergermeier <germeier>2003-04-19 23:58:02 +0000
commit7935e28c8e5956849f1a1432dc7ae8e5ef4ea414 (patch)
tree492e08b64204151ea4001a21046d642d98d7d607 /mpiosh
parentb44b29a82825c1a898024f9a9943fa71587aaf4b (diff)
downloadmpiosh-7935e28c8e5956849f1a1432dc7ae8e5ef4ea414.tar.gz
mpiosh-7935e28c8e5956849f1a1432dc7ae8e5ef4ea414.tar.bz2
mpiosh-7935e28c8e5956849f1a1432dc7ae8e5ef4ea414.zip
added function(s) to rename files on the player
Diffstat (limited to 'mpiosh')
-rw-r--r--mpiosh/callback.c21
-rw-r--r--mpiosh/callback.h3
-rw-r--r--mpiosh/global.c7
3 files changed, 27 insertions, 4 deletions
diff --git a/mpiosh/callback.c b/mpiosh/callback.c
index 337d1d2..768222a 100644
--- a/mpiosh/callback.c
+++ b/mpiosh/callback.c
@@ -2,7 +2,7 @@
*
* Author: Andreas Büsching <crunchy@tzi.de>
*
- * $Id: callback.c,v 1.40 2003/04/19 11:41:26 germeier Exp $
+ * $Id: callback.c,v 1.41 2003/04/19 23:58:02 germeier Exp $
*
* Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de>
*
@@ -737,6 +737,25 @@ mpiosh_cmd_switch(char *args[])
}
void
+mpiosh_cmd_rename(char *args[])
+{
+ MPIOSH_CHECK_CONNECTION_CLOSED;
+
+ if(args[0] && args[1] && !args[2]) {
+ if ((mpio_file_rename(mpiosh.dev, mpiosh.card,
+ args[0], args[1])) == -1) {
+ mpio_perror("error");
+ } else {
+ mpio_sync(mpiosh.dev, mpiosh.card);
+ }
+
+ } else {
+ fprintf(stderr, "error: wrong number of arguments given\n");
+ printf("rename <oldfilename> <newfilename>\n");
+ }
+}
+
+void
mpiosh_cmd_dump_mem(char *args[])
{
diff --git a/mpiosh/callback.h b/mpiosh/callback.h
index 8d6be74..3d1c8f8 100644
--- a/mpiosh/callback.h
+++ b/mpiosh/callback.h
@@ -2,7 +2,7 @@
*
* Author: Andreas Büsching <crunchy@tzi.de>
*
- * $Id: callback.h,v 1.10 2003/04/19 09:32:48 germeier Exp $
+ * $Id: callback.h,v 1.11 2003/04/19 23:58:02 germeier Exp $
*
* Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de>
*
@@ -49,6 +49,7 @@ void mpiosh_cmd_dump(char *args[]);
void mpiosh_cmd_free(char *args[]);
void mpiosh_cmd_format(char *args[]);
void mpiosh_cmd_switch(char *args[]);
+void mpiosh_cmd_rename(char *args[]);
void mpiosh_cmd_dump_mem(char *args[]);
void mpiosh_cmd_health(char *args[]);
void mpiosh_cmd_config(char *args[]);
diff --git a/mpiosh/global.c b/mpiosh/global.c
index 2f10870..0047627 100644
--- a/mpiosh/global.c
+++ b/mpiosh/global.c
@@ -2,7 +2,7 @@
*
* Author: Andreas Buesching <crunchy@tzi.de>
*
- * $Id: global.c,v 1.10 2003/04/19 09:32:48 germeier Exp $
+ * $Id: global.c,v 1.11 2003/04/19 23:58:02 germeier Exp $
*
* Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de>
*
@@ -50,7 +50,7 @@ struct mpiosh_cmd_t commands[] = {
{ "ver", NULL, NULL,
" version of mpio package",
mpiosh_cmd_version, NULL },
- { "help", NULL, "[<command>]",
+ { "help", (char *[]){ "?", NULL }, "[<command>]",
" show information about known commands or just about <command>",
mpiosh_cmd_help, mpiosh_readline_comp_cmd },
{ "dir", (char *[]){ "ls", "ll", NULL }, NULL,
@@ -105,6 +105,9 @@ struct mpiosh_cmd_t commands[] = {
{ "switch", NULL, "<file1> <file2>",
" switches the order of two files",
mpiosh_cmd_switch, mpiosh_readline_comp_mpio_file },
+ { "rename", (char *[]){ "ren", NULL }, "<oldfilename> <newfilename>",
+ " renames a file on the current memory card",
+ mpiosh_cmd_rename, mpiosh_readline_comp_mpio_file },
{ "ldir", (char *[]){ "lls", NULL }, NULL,
" list local directory",
mpiosh_cmd_ldir, NULL },