?? makespread.java
字號:
package fengyun.Fastmail.util;
import java.io.File;
import java.io.IOException;
/**
* 創建分布的目錄
* @author fengyun
* @version 1.00
*/
public class MakeSpread {
/**
* 創建
* @param max 分布個數
*/
public static void make(String home,int max,String owner) {
for (int i = 1; i <= max; i++) {
File spread = new File(home + File.separator + i); if (spread.exists()) continue;
else spread.mkdir();
}
if (owner == null)
owner="virtual";
File file = new File(home); try { Runtime chg=Runtime.getRuntime(); chg.exec("/bin/chown -R " + owner + ". " + file.getAbsolutePath()); chg.exec("/bin/chmod -R 711 " + file.getAbsolutePath()); } catch(IOException ioe) { ioe.printStackTrace(); } }
public static void main(String[] args) {
if (args.length < 2) {
System.out.println("java MakeSpread home maxnumber owner");
}
try {
if (args.length == 3) {
make(args[0],Integer.parseInt(args[1]),args[2]);
}
else {
make(args[0],Integer.parseInt(args[1]),null);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -