Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我看了一点,但没有找到答案。是否可以在没有任何黑客攻击的情况下找出服务器系统驱动器/文件夹?
在您提供的答案中,仅讨论了如何确定当前驱动器,但我需要找出安装操作系统的系统驱动器。
对于 Windows:
echo GetEnv("SystemDrive"); // C:
虽然在 Unix/Linux 上这个变量不存在,但系统“驱动器”可以预见只是/.
/
如果您需要实际的分区,可以尝试使用以下方法获取它:
exec( 'mount |grep " / " | cut -d " " -f 1' ); // /dev/sda1