I have this script stolen and modified from somewhere 

#!/usr/bin/perl -w
use strict;
use File::Find;
print "Content-type: text/html\n\n";

my $u=shift;
my $sizes = 0;
# replace this with your absolute path
my $path = "/home/$u/";

find (sub {$sizes += -s ;}, $path);
print  "$sizes\n";


I am logged onto my machine as user owen and am root. From the command line I execute

perl  /var/www/cgi-bin/ff1.cgi owen     with the result

--------------------------
Content-type: text/html

(warnings snipped)

504137000
---------------------------

with rcook as the user in /home the result is 988865

Now when I do 'links http://localhost/cgi-bin/ff1.cgi?owen'

the result is 350200607 (vs 504137000 ???) and 
for user rcook the result is 0 (vs 988865)

du gives me yet another set of answers as does other File::Find type programs I have 
found, but that is not the problem at the moment.

Why do I get  0 for rcook when I run it through the browser?
I suspect the difference is something to do with permissions of the cgi script when 
run as a cgi script but do not know.



Any advice/clues would be most welcome


TIA

-- 
Owen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to