diff options
Diffstat (limited to 'uisimulator/win32/io.c')
-rw-r--r-- | uisimulator/win32/io.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/uisimulator/win32/io.c b/uisimulator/win32/io.c new file mode 100644 index 0000000000..974fdadbbd --- /dev/null +++ b/uisimulator/win32/io.c | |||
@@ -0,0 +1,38 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Daniel Stenberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "file.h" | ||
21 | #include "debug.h" | ||
22 | |||
23 | #define SIMULATOR_ARCHOS_ROOT "archos" | ||
24 | |||
25 | int win32_rename(char *oldpath, char* newpath) | ||
26 | { | ||
27 | char buffer1[256]; | ||
28 | char buffer2[256]; | ||
29 | |||
30 | if(oldpath[0] == '/') { | ||
31 | sprintf(buffer1, "%s%s", SIMULATOR_ARCHOS_ROOT, oldpath); | ||
32 | sprintf(buffer2, "%s%s", SIMULATOR_ARCHOS_ROOT, newpath); | ||
33 | |||
34 | debugf("We rename the real file '%s' to '%s'\n", buffer1, buffer2); | ||
35 | return rename(buffer1, buffer2); | ||
36 | } | ||
37 | return -1; | ||
38 | } | ||