in reply to Re^6: Duplicates in Directories
in thread Duplicates in Directories
I am not sure what "the files in the order in which they are stored in the directory" really means; as as I can say, the files are not stored in any specific order on disk (they may even be scattered on non continuous blocks), it is the file system (FAT, ext2, ext3, NTFS, etc.) which may give some sort of order to the collection of files. So the question is really: how does the file system returns the entries for a given directory?
Finally, using readdir still gives me the file in ASCIIbetical order (or, at least, in a pseudo-alphabetical order which is perfectly suitable for the proposal made by AnoMonk):
$ perl -E 'opendir $d, "."; say $_ for readdir $d;' . .. , ---------------------------------------------------------------------- +-------------- .bashrc .bashrc~ .bash_history .bash_profile .cpan .emacs.d .inputrc .joe_state .lesshst .minttyrc .perldb_t .profile .ssh 1000 1095341.pl 172.20.98.3.txt 2000 500 8188eu-v7-20150914.tar.gz a.exe a.pl abdou.pl Acme add2.pl add_2.pl age_switch.pl [many lines omitted for brevity] xml.pl xml_mac.pl xxxA.txt xxxH.txt xxxL.txt X_oper.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Duplicates in Directories
by huck (Prior) on Oct 09, 2017 at 22:40 UTC |