Author: omalley
Date: Wed Jun 4 10:23:22 2008
New Revision: 663317
URL: http://svn.apache.org/viewvc?rev=663317&view=rev
Log:
HADOOP-3459. Change in the output format of dfs -ls to more closely match
/bin/ls. New format is: perm repl owner group size date name. Contributed by
Mukund Madhugiri.
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java
Modified: hadoop/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=663317&r1=663316&r2=663317&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Wed Jun 4 10:23:22 2008
@@ -71,6 +71,9 @@
A connection with outstanding requests won't be treated as idle.
(hairong)
+ HADOOP-3459. Change in the output format of dfs -ls to more closely match
+ /bin/ls. New format is: perm repl owner group size date name (Mukund
Madhugiri via omally)
+
NEW FEATURES
HADOOP-3074. Provides a UrlStreamHandler for DFS and other FS,
Modified: hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java
URL:
http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java?rev=663317&r1=663316&r2=663317&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/fs/FsShell.java Wed Jun 4
10:23:22 2008
@@ -652,13 +652,16 @@
FileStatus stat = items[i];
Path cur = stat.getPath();
String mdate = dateForm.format(new Date(stat.getModificationTime()));
- System.out.printf("%-"+ (maxReplication + BORDER)
- +"s", (!stat.isDir() ? stat.getReplication() : ""));
- System.out.printf("%-"+ (maxLen + BORDER) +"d", stat.getLen());
- System.out.print(mdate + " "
- + (stat.isDir() ? "d" : "-") + stat.getPermission() + " ");
- System.out.printf("%-"+ (maxOwner + BORDER) +"s", stat.getOwner());
- System.out.printf("%-"+ (maxGroup + BORDER) +"s", stat.getGroup());
+
+ System.out.print((stat.isDir() ? "d" : "-") +
+ stat.getPermission() + " ");
+ System.out.printf("%"+ maxReplication +
+ "s ", (!stat.isDir() ? stat.getReplication() : "-"));
+ System.out.printf("%-"+ maxOwner +
+ "s ", stat.getOwner());
+ System.out.printf("%-"+ maxGroup +"s ", stat.getGroup());
+ System.out.printf("%"+ maxLen + "d ", stat.getLen());
+ System.out.print(mdate + " ");
System.out.println(cur.toUri().getPath());
if (recursive && stat.isDir()) {
ls(cur,srcFs, recursive, printHeader);