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

Version 2 (modified by Don Wilson, 14 years ago) ( diff )

--

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

Note: See TracWiki for help on using the wiki.