is_file/is_dir和file_exists

is_file:判断文件是否存在
is_dir:判断目录是否存在
file_exists:判断文件/目录是否存在

速度比较

  is_file/is_dir file_exists
当目标文件/目录存在时 较快 较慢
当目标文件/目录不存在时 相同 相同

猜你喜欢

转载自blog.csdn.net/chenmiaoqin950606/article/details/79696655