Forum Moderators: coopster

Message Too Old, No Replies

Checking for large files

> 2 GB

         

sned

12:30 am on Jun 29, 2005 (gmt 0)

10+ Year Member



I have a script that creates tarballs of directories, then makes them available for download. However, if the tarball is above a certain size, nothing is displayed in the web page ....

I've tried file_exists, is_file, and just hardcoded in filesize, but none of them return any results.

Is there something I have to do to get a filesize or name for a file larger than 2 GB?

Thanks,
-sned

coopster

1:13 pm on Jun 29, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



sprintf("%u", filesize($file))

Resource:
filesize [php.net]

sned

4:14 pm on Jun 29, 2005 (gmt 0)

10+ Year Member



Hi Coopster, I've tried that method, it still just prints out 0 .. it works fine with a 1.99 GB file, but my other file that is 2.3 GB doesn't seem to exist as far as php is concerned. I wonder if it's an OS issue ....

<edit>
After some more googling, I think this is a file system issue, something with ext2 ...

Thanks for your help!
-sned
</edit>

coopster

8:34 pm on Jun 29, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Certainly something to do with the whole 32-bit integer issue I'm sure, but don't know of any workarounds or solutions otherwise. I'd be interested to find out though if/when you come across anything.

freeflight2

9:02 pm on Jun 29, 2005 (gmt 0)

10+ Year Member



old ext2 implementations dont't support files >2GB - use ext3

all kinds of strange things start happening once you hit FS limits or mysql max_table_size (4GB) limits