Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
32bit-stat.patch | 1.46 KB | matt westgate | |
Comments
Comment #1
arthurf CreditAttribution: arthurf commentedWill 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.
Comment #2
msonnabaum CreditAttribution: msonnabaum commented"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.
Comment #3
arthurf CreditAttribution: arthurf commentedI 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