From 7935e28c8e5956849f1a1432dc7ae8e5ef4ea414 Mon Sep 17 00:00:00 2001 From: germeier Date: Sat, 19 Apr 2003 23:58:02 +0000 Subject: added function(s) to rename files on the player --- libmpio/mpio.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'libmpio/mpio.c') diff --git a/libmpio/mpio.c b/libmpio/mpio.c index 4bf1082..04c3b58 100644 --- a/libmpio/mpio.c +++ b/libmpio/mpio.c @@ -1,6 +1,6 @@ /* * - * $Id: mpio.c,v 1.52 2003/04/19 09:32:48 germeier Exp $ + * $Id: mpio.c,v 1.53 2003/04/19 23:58:02 germeier Exp $ * * Library for USB MPIO-* * @@ -896,6 +896,25 @@ mpio_file_switch(mpio_t *m, mpio_mem_t mem, return 0; } +int +mpio_file_rename(mpio_t *m, mpio_mem_t mem, + mpio_filename_t old, mpio_filename_t new) +{ + BYTE *p; + + /* find files */ + p = mpio_dentry_find_name(m, mem, old); + if (!p) + p = mpio_dentry_find_name_8_3(m, mem, old); + + if (!p) + MPIO_ERR_RETURN(MPIO_ERR_FILE_NOT_FOUND); + + mpio_dentry_rename(m, mem, p, new); + + return 0; +} + int mpio_file_move(mpio_t *m,mpio_mem_t mem, mpio_filename_t file, mpio_filename_t after) { -- cgit v1.2.3