📄 ls.java
字号:
/******************************************************************************* Filename :ls.java
* Description :ls command
*
* Author :xunzy
*
* History :2004-02-16 Created******************************************************************************/import java.util.Vector;import java.io.*;public class ls implements Command { public void execute(File c, Vector v) throws CommandException { // Check for current dir; throw an exception if there is null if (FileSystemShell.getCurrentDir() == null) throw new CommandException(new Exception(), "Error: no current context."); // Call list() and then loop through the results, printing the names String[] enum = c.list(); int i=0; while (i<enum.length) { System.out.println(enum[i]); i++; } } public void help() { System.out.println("Usage: list [dirName]"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -