Random question: Got Apache?

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Anyone running an apache server? I got a simple question, how come my files are not alphabatizing when I upload them? How can I make that hapen?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
opendir(DIR, "/var/www/httpd/htdocs/");
@contents = readdir(DIR);
closedir(DIR);
@sorted = sort(@contents);

foreach $file(@sorted){
print "$file\n";
}


:)

Is apache running on your server, did you set it up yourself? That's kind of an unusual problem.
 

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Yeah, I set it up myself, but im FTPing a whole bunch of songs from one computer to my server computer
and they are not coming in any order...
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Where are they out of order, in the FTP client, in the apache directory listing on the website? Are they in order if you do a ls in the directory you're uploading to? Link to the site?
 

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Im not going to link yet, because I dont want people downloading and disturbing my upload. The thing is, they were all in order in the directory, but it looks like this in the server screen...

a
b
c
d
*e...
*...z

Then its like it thinks there is another half and it goes
a
b
c
d
*e...
*...z

Its like there are a lot of files, but half way through after the lazt Z it starts over with A, and they are all different files. Like it just split all the files in half, into two A-Z lists. Its hard to describe I hope that helped.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0


<< Isn't Apache a type of helicopter? >>



yep, also an Indian tribe, and a webserver.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0


<< Im not going to link yet, because I dont want people downloading and disturbing my upload. The thing is, they were all in order in the directory, but it looks like this in the server screen...

a
b
c
d
*e...
*...z

Then its like it thinks there is another half and it goes
a
b
c
d
*e...
*...z

Its like there are a lot of files, but half way through after the lazt Z it starts over with A, and they are all different files. Like it just split all the files in half, into two A-Z lists. Its hard to describe I hope that helped.
>>



PM me the link? I think I need to see it...
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
if you didn't notice, your webserver is listing capitalized files before lowercase ones. This is bacuase it's sorting files based on the ASCII values of thier characters, rather than strctly alphabetically. Apache (on unix) has never lsited directories bofore files, it mixes them in, in order.

ascii table.

I'm going to PM you something you might find useful, does your server support Perl?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0


<< Damn I am stupid, thanks for letting me know that, yes I do support perl. >>



hold on, gotta install a perl module real quick, the server that I was gonna show you is down :)
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
OK, corporate Recreation - You'll want to see this. Sorry it took so long, but I had to convert a script that was originally written for windows to be used on my linux box :)

Check your PM
 

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Thanks, I got it, and I changed them all myself, because I thought you forgot about me :p
Ill keep it in my records though, thanks for taking the time to help me out.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
did you look at the page I sent? the script sorts without case sensitivity, and also will tell you the length, bitrate, and fileszie of MP3s :)

also, it looks better than the default directory listing :)
 

Platypus

Lifer
Apr 26, 2001
31,046
321
136
Can you just PM me the code? Ive never really used perl that much and I am kind of a newbie with apache too.