[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
submitting patch for coreutils package
From: |
Chris Van Nuys |
Subject: |
submitting patch for coreutils package |
Date: |
Thu, 11 Dec 2003 19:10:56 -0800 |
Hello,
I am submitting a patch for the program 'ls'. This patch changes the
way that 'ls' output's long_output ('ls -l', -g, etc). The way it changes
the output is that it adds the Octal equivalent of the permission modes
next to the regular rwxrwxrwx style permissions. New users, and even
veterans usually have a hard time remembering the octal equivalents when
doing routine maintenance on their machines using 'chmod', and often have
to look up the values in a table. Why should users have to look up
rwxrwxrwx conversions for chmod? I don't think they should. This is a
very small patch, I ask that you consider implementing it and letting me
know if you decide to use it or not. I think this would be *very* useful
to the unix community. This is my first time submitting a patch, I hope I
did it right :)
A quick example of what it looks like after the change and running 'ls -l':
-rwxr-xr-x [ 755] 1 mrdurden user 91717 2003-12-11 18:44 uptime
Here is the patch:
---------------------- Begin Paste
--- ls.c Thu Dec 11 18:45:22 2003
+++ newls.c Thu Dec 11 18:52:30 2003
@@ -2975,7 +2975,7 @@
/* The last byte of the mode string is the POSIX
"optional alternate access method flag". */
- sprintf (p, "%s %3lu ", modebuf, (unsigned long) f->stat.st_nlink);
+ sprintf (p, "%s [%4o] %3lu ", modebuf, f->stat.st_mode & 07777,
(unsigned long) f->stat.st_nlink);
p += strlen (p);
if (print_owner)
------------------------ End paste
Please let me know what you think,
Thank you very much for your time, and for donating your time to create
such wonderful unix utilities,
Chris Van Nuys
- submitting patch for coreutils package,
Chris Van Nuys <=