diff options
Diffstat (limited to 'uisimulator/win32/io.c')
-rw-r--r-- | uisimulator/win32/io.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/uisimulator/win32/io.c b/uisimulator/win32/io.c deleted file mode 100644 index 023e767b6a..0000000000 --- a/uisimulator/win32/io.c +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
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 <stdio.h> | ||
21 | #include "file.h" | ||
22 | #include "debug.h" | ||
23 | |||
24 | #define SIMULATOR_ARCHOS_ROOT "archos" | ||
25 | |||
26 | int win32_rename(char *oldpath, char* newpath) | ||
27 | { | ||
28 | char buffer1[256]; | ||
29 | char buffer2[256]; | ||
30 | |||
31 | if(oldpath[0] == '/') { | ||
32 | sprintf(buffer1, "%s%s", SIMULATOR_ARCHOS_ROOT, oldpath); | ||
33 | sprintf(buffer2, "%s%s", SIMULATOR_ARCHOS_ROOT, newpath); | ||
34 | |||
35 | debugf("We rename the real file '%s' to '%s'\n", buffer1, buffer2); | ||
36 | return rename(buffer1, buffer2); | ||
37 | } | ||
38 | return -1; | ||
39 | } | ||
40 | |||
41 | int win32_filesize(int fd) | ||
42 | { | ||
43 | int old = lseek(fd, 0, SEEK_CUR); | ||
44 | int size = lseek(fd, 0, SEEK_END); | ||
45 | lseek(fd, old, SEEK_SET); | ||
46 | |||
47 | return(size); | ||
48 | } | ||
49 | |||
50 | extern int (mkdir)(const char *name); | ||
51 | |||
52 | int win32_mkdir(const char *name, int mode) | ||
53 | { | ||
54 | char buffer[256]; /* sufficiently big */ | ||
55 | (void)mode; | ||
56 | if(name[0] == '/') { | ||
57 | sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name); | ||
58 | |||
59 | debugf("We create the real directory '%s'\n", buffer); | ||
60 | return (mkdir)(buffer); | ||
61 | } | ||
62 | return (mkdir)(name); | ||
63 | } | ||