One possible solution is to check /proc/mounts if it contains exact path that you expected to be mounted.
Or you could use fpStatFS() and check the result for congruence.
Is this "dangerous" or not?
I tried function fpStatFS from Unit Unix:
[. . .]
How do you think that I can distinguish mounted state and not mounted state?
File system types:
[. . .]
EXT_SUPER_MAGIC 0x137D
EXT2_OLD_SUPER_MAGIC 0xEF51
EXT2_SUPER_MAGIC 0xEF53
EXT3_SUPER_MAGIC 0xEF53
EXT4_SUPER_MAGIC 0xEF53
HFS_SUPER_MAGIC 0x4244
HPFS_SUPER_MAGIC 0xF995E849
[. . .]
MSDOS_SUPER_MAGIC 0x4d44
NCP_SUPER_MAGIC 0x564c
NFS_SUPER_MAGIC 0x6969
NTFS_SB_MAGIC 0x5346544e
[. . .]
Although you may as well "slurp" the whole file in one pass and then search into the buffer, if just to minimize file operations.Do you mean: read that file in binary mode into an ansistring and then search in that ansistring with pos() like:
Although you may as well "slurp" the whole file in one pass and then search into the buffer, if just to minimize file operations.Do you mean: read that file in binary mode into an ansistring and then search in that ansistring with pos() like:
[... some code ...]