wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/IsMounted

IsMounted

Check whether the specified file device is mounted

int IsMounted(const string& strMount);

int IsMounted(const char* pszMount);

Parameters

  • strMount - string variable containing name to check
  • pszMount - character array containing name to check

Return Value

  • Returns 1 if device is mounted, 0 if it is not mounted

Remarks

The function operates by reading /proc/mounts and checking for string match. The lib825ev library does not include a function to mount a file system, but you can use a system call such as: system("mount -t vfat /dev/sda1 /mnt/fl1");

Examples

string strMnt = "/mnt/fl1";
if(IsMounted(strMnt) == 0)
{
  DisplayText(0, 0, "Flash is not mounted");
}
if(IsMounted("/mnt/fl1") == 0)
{
  DisplayText(0, 0, "Flash is not mounted");
}

See Also

Last modified 6 months ago Last modified on 05/17/24 12:27:22
Note: See TracWiki for help on using the wiki.