On Thu, 2002-09-05 at 20:10, Todd A. Jacobs wrote:
> I have a need to modify the directory sort order. I'm not currently trying 
> to swab the output; I want to actually modify the order in which files are 
> listed within the directory itself.
> 
> Does anyone know how I can actually modify the contents of the directory 
> listing?
> 

No idea.  I assume that the actual entry order is that returned by ls
-f? Things I would try in the absence of further information is creating
a directory and then hardlinking the files from the original dir into
them in the order I wanted.  If that works then you can rm the orig dir
and mv the new one on top of it or I guess just mv ing the new onto the
lod would probably do unless someone has built some optimizations into
the mv command for files that are linked to the same file being mv ed
over the old ones. 

If indeed ls -f works to see the order of the actual directory lisings,
then this appears to work.  here are the results of a quick test on a rh
6.0 box.

[bhughes@compaq2 bhughes]$ mkdir bincopy
[bhughes@compaq2 bhughes]$ for f in `ls bin/`;do ln bin/$f bincopy;done
ln: bin/testbin: hard link not allowed for directory
[bhughes@compaq2 bhughes]$ ls -f bin
.        testcp          listout      radarsave.pl      cddistul
..       sortrpmdate.pl  listRPMSdir  startXvfb
testbin  testout         dirlist      nohup.out
pingosu  cleanRPMSdir    deletelist   addAdvertiser.pl
[bhughes@compaq2 bhughes]$ ls -f bincopy
.                 cleanRPMSdir  listout       sortrpmdate.pl
..                deletelist    nohup.out     startXvfb
addAdvertiser.pl  dirlist       pingosu       testcp
cddistul          listRPMSdir   radarsave.pl  testout


It appears that the order of the files are now in alphabetical order. 
permissions are not carried across though but you get the idea of my
lame hack.

Now for the obvious question, why do you care?  are you mad because php
won't buzz a directory in any sorted order?

Bret



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to