The php function stat() only works for files less than 2GB on 32 bit PHP systems. For files larger than 2 GB you need to something like:

$mtime = exec ('stat -c %Y '. escapeshellarg ($file->filename));

Since the code in mm_dir is only looking for a last modified timestamp, I don't see a real downside to checking this way to support larger file transfers.

CommentFileSizeAuthor
32bit-stat.patch1.46 KBmatt westgate
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arthurf’s picture

Will this successfully replace filesize() as well? Reading the php docs, it seems like they are suggesting: sprintf("%u", filesize($file)).... Any thoughts about which way to go? I'm using filesize quite a bit right now, so I'd like to come up with one approach that I can use for all the different modules.

msonnabaum’s picture

"stat -c %Y" won't work on BSD, maybe Solaris too.

Unfortunately, stat, find, and ls all have different output formatting when it comes to printing mtime between linux and BSD.

Not really sure what to do here.

arthurf’s picture

I think the options would be to 1) follow drupal implementations, 2) provide a wrapper that is OS aware 3) ignore it and let people who have this issue modify the appropriate files