- $dh = opendir('/dev/disk/by-uuid/');
- while($file = readdir($dh)){
- if(is_link('/dev/disk/by-uuid/'.$file)){
- if( realpath('/dev/disk/by-uuid/'.$file) == '/dev/sda1'){
- echo 'Found uuid='.$file.PHP_EOL;
- }
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/170120131718.html
来源: http://www.codesnippet.cn/detail/170120131718.html