Browse Source

!200 FileUtil.size 方法在linux node_modules 目录死循环
Merge pull request !200 from 不忘初心/v5-dev

Looly 5 years ago
parent
commit
093363f3b9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java

+ 1 - 1
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java

@@ -511,7 +511,7 @@ public class FileUtil extends PathUtil {
 	 * @return 总大小,bytes长度
 	 */
 	public static long size(File file) {
-		if (null == file || false == file.exists()) {
+		if (null == file || false == file.exists() || FileUtil.isSymlink(file)) {
 			return 0;
 		}