The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
filesize infyanurag Shell Programming and Scripting 3 05-15-2008 02:00 AM
UNIX and filesize ndoggy020 UNIX for Dummies Questions & Answers 3 12-06-2007 01:14 PM
How to truncate as filesize? Lestat Shell Programming and Scripting 1 06-07-2005 12:24 PM
Sorting ls by filesize peter.herlihy UNIX for Dummies Questions & Answers 2 06-04-2002 05:40 PM
FileSize ??? Cameron Shell Programming and Scripting 3 05-28-2002 07:34 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-11-2002
Registered User
 

Join Date: Jan 2002
Posts: 7
filesize

I know in php if you use the function filesize it will return the size of the file in bytes, but is there an easy way to get the size in MB.
Cheers
Reply With Quote
Forum Sponsor
  #2  
Old 02-12-2002
Registered User
 

Join Date: Feb 2002
Location: www.freebsdforums.org
Posts: 67
Write you own php function called myfilesize:

pseudo code:

function myfilesize($fname) {
return filesize($fname/(1024*1024));
}

i.e. divide it by 1024 twice!

Best Wishes!
__________________
FreeBSD: The best free Unix on this planet IMHO!!

FreeBSD Forums
www.freebsdforums.org
Reply With Quote
  #3  
Old 02-13-2002
Registered User
 

Join Date: Jan 2002
Posts: 7
thanks

Thanks a million,
but I managed to get around it by using substr.
Thanks again
John
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0