📄 finddirectories.java
字号:
/**
* @version 1.00 05 Sep 1997
* @author Gary Cornell
*/
import java.io.*;
public class FindDirectories
{ public static void main(String[] args)
{ if (args.length == 0) args = new String[] { ".." };
try
{ File pathName = new File(args[0]);
String[] fileNames = pathName.list();
for (int i = 0; i<fileNames.length; i++)
{ File tf = new File(pathName.getPath(),
fileNames[i]);
if (tf.isDirectory())
{ System.out.println(tf.getCanonicalPath());
main(new String [] { tf.getPath() });
}
}
}
catch(IOException e)
{ System.out.println("Error: " + e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -