Annoying new feature of 4.2 'ls -F'
Donn Seeley
donn at sdchema.UUCP
Sun Feb 12 19:01:10 AEST 1984
The distributed 4.2 BSD 'ls' has the 'feature' that if a symbolic link
points to a directory, 'ls -F' won't tell you that the file is a
symbolic link. This is a benefit to people who use plain 'ls' and
would like to see the difference between a link to a normal file and a
link to a directory. (I'm all for this, except I would rather see both
attributes represented instead of dropping the information that the
file is a link. For example a link 'symdir' to a directory would be
listed by 'ls -F' as 'symdir@/'.) As things stand however, I would
prefer the old behavior over the new behavior. I alias 'ls' to 'ls -F'
and use the old 'ls' to detect symbolic links. I'm too lazy at the
moment to implement my parenthetical suggestion, so I re-created the
old behavior by ifdeffing out the new 'feature':
------------------------------------------------------------
*** /usr/src/bin/ls.c Sun Sep 25 18:05:04 1983
--- ls.c Sat Feb 11 23:47:56 1984
***************
*** 309,314
}
break;
}
if (stat(file, &stb1) < 0)
break;
if ((stb1.st_mode & S_IFMT) == S_IFDIR) {
--- 309,315 -----
}
break;
}
+ #ifdef notdef
if (stat(file, &stb1) < 0)
break;
if ((stb1.st_mode & S_IFMT) == S_IFDIR) {
***************
*** 317,322
fp->fsize = stb.st_size;
fp->fblks = stb.st_blocks;
}
break;
}
fp->fnum = stb.st_ino;
--- 318,324 -----
fp->fsize = stb.st_size;
fp->fblks = stb.st_blocks;
}
+ #endif notdef
break;
}
fp->fnum = stb.st_ino;
------------------------------------------------------------
Regardless of one's feelings on the matter, there IS a bug in the
documentation -- this 'feature' is never mentioned. While I'm on the
subject, there is no entry for the '-A' option either... I guess with
so many options and features it's easy to miss one here and there.
Donn Seeley UCSD Chemistry Dept. RRCF ucbvax!sdcsvax!sdchema!donn
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list