3 * - By John Hodge (thePowersGang)
6 * - High level actions that call the VFS
7 * # Kernel-space compiled
10 #include <disktool_common.h>
14 size_t DiskTool_int_TranslatePath(char *Buffer, const char *Path);
15 int DiskTool_int_TranslateOpen(const char *File, int Mode);
18 int DiskTool_MountImage(const char *Identifier, const char *Path)
20 // Validate Identifier and make mountpoint string
21 char mountpoint[sizeof("/Mount/") + strlen(Identifier) + 1];
22 strcpy(mountpoint, "/Mount/");
23 strcat(mountpoint, Identifier);
26 size_t tpath_len = DiskTool_int_TranslatePath(NULL, Path);
29 char tpath[tpath_len-1];
30 DiskTool_int_TranslatePath(tpath, Path);
33 // TODO: Detect filesystem?
34 return VFS_Mount(tpath, mountpoint, "fat", "");
37 int DiskTool_Copy(const char *Source, const char *Destination)
42 // --- Internal helpers ---
43 size_t DiskTool_int_TranslatePath(char *Buffer, const char *Path)
45 const char *colon = strchr(Path, ':');
49 for(pos = Path; pos < colon; pos ++)
64 int DiskTool_int_TranslateOpen(const char *File, int Mode)
66 // Determine if the source is a mounted image or a file on the source FS