CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
'stat' and file $size retrieval



Feb 3, 2001, 6:28 PM

Post #1 of 1 (1167 views)
'stat' and file $size retrieval Can't Post

I am having difficulty getting the perl stat command to work in my file upload script.

from research I have done, I understand that using stat in order to find file attributes such as filesize and last modified etc.. you need to formulate it something like this:

$size = (stat(""))[7];

print "File size is $size";


print ((stat($filename))[7], "\n");

( [7] being the assigned integer for filesize. )

I have a file upload script and I need to have the file size for each file that has been uploaded and added to the output template (file listing) to show the filesize.

The script has 4 pl files. One to add a file, the prefs file, an admin file and another file that handles sorting and searching the file listing (there's a search form)

Maybe someone can take a look at the .pl that handles the upload of files and let meknow where and how I should use the stat command to print filesize.
maybe not.




Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives