22 aFile = setmntent(
"/proc/mounts",
"r");
25 while(NULL != (ent = getmntent(aFile)))
27 x =
ansicstr(ent->mnt_dir, strlen(ent->mnt_dir), 0, NULL, NULL);
30 if((strstr(AbsFile, x) == AbsFile) && (strlen(x) > strlen(Root)))
33 strcpy(Dev, ent->mnt_fsname);
37 else if((strstr(AbsFile, ent->mnt_dir) == AbsFile) && (strlen(ent->mnt_dir) > strlen(Root)))
39 strcpy(Root, ent->mnt_dir);
40 strcpy(Dev, ent->mnt_fsname);
47 if(*Root && (Root[strlen(Root) - 1] !=
'/')) strcat(Root,
"/");
48 if(*Dev && (Dev[strlen(Dev) - 1] !=
'/')) strcat(Dev,
"/");
50 if(MountPoint) strcpy(MountPoint, Root);
51 if(MountDevice) strcpy(MountDevice, Dev);
54 return (Root[0] !=
'\0' || Dev[0] !=
'\0');
void ConvertPathType(const char *Source, char *Dest, tPathFormat DestFormat)
struct __STDIO_FILE_STRUCT FILE
bool HDD_FindMountPointDevice(const char *File, char *MountPoint, char *MountDevice)
char * ansicstr(const char *string, int len, int flags, int *sawc, int *rlen)