MartinK Posted January 17, 2023 Share Posted January 17, 2023 (edited) Hi, Is there a PHP way of determining filesystem type like xfs, ext4, etc. without additional (non-standard) PHP modules or libraries? Access to the command line is forbidden for security reasons. Thank you in advance for your help. Martin Edited January 17, 2023 by MartinK additional note Quote Link to comment https://forums.phpfreaks.com/topic/315811-php-determine-file-system-type/ Share on other sites More sharing options...
kicken Posted January 17, 2023 Share Posted January 17, 2023 On Linux you could try parsing /proc/mounts but otherwise I don't think so. Quote Link to comment https://forums.phpfreaks.com/topic/315811-php-determine-file-system-type/#findComment-1604768 Share on other sites More sharing options...
benanamen Posted January 17, 2023 Share Posted January 17, 2023 This might work for you.https://linfo.sourceforge.net/ Quote Link to comment https://forums.phpfreaks.com/topic/315811-php-determine-file-system-type/#findComment-1604774 Share on other sites More sharing options...
gizmola Posted January 18, 2023 Share Posted January 18, 2023 13 hours ago, MartinK said: Hi, Is there a PHP way of determining filesystem type like xfs, ext4, etc. without additional (non-standard) PHP modules or libraries? Access to the command line is forbidden for security reasons. No. If it's linux you can do something like this with mount: <?php exec('mount', $output, $result); if ($result == 0) { echo "<pre>"; var_dump($output); echo "</pre>"; } else { echo "Failed with result: $result<br>"; } If that works, I leave the parsing of filesystem from the output to you. You'd also have to determine which filesystem is relevant perhaps using getcwd or realpath(__FILE__) Quote Link to comment https://forums.phpfreaks.com/topic/315811-php-determine-file-system-type/#findComment-1604785 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.