Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.6.0
-
None
-
None
Description
Add option -q to "hdfs dfs -ls" to print non-printable characters as "?". Non-printable characters are defined by isprint(3) according to the current locale.
Default to -q behavior on terminal; otherwise, print raw characters. See the difference in these 2 command lines:
- hadoop fs -ls /dir
- hadoop fs -ls /dir | od -c
In C, isatty(STDOUT_FILENO) is used to find out whether the output is a terminal. Since Java doesn't have isatty, I will use JNI to call C isatty() because the closest test System.console() == null does not work in some cases.
Attachments
Attachments
Issue Links
- breaks
-
HADOOP-14199 TestFsShellList.testList fails on windows: illegal filenames
- Patch Available
-
HADOOP-13314 Remove 'package-info.java' from 'test\java\org\apache\hadoop\fs\shell\' to remove eclipse compile error
- Resolved
- is duplicated by
-
HDFS-4821 It's possible to create files with special characters in the filenames, but 'hadoop fs -ls' gives no indication
- Resolved
- is required by
-
HADOOP-13093 Discuss whether dfs -ls should escape control characters on terminal
- Open
- relates to
-
HDFS-240 Should HDFS restrict the names used for files?
- Open
-
HADOOP-15496 TestFsShellList#testList fails on Windows
- Resolved