ericmckean / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Write failed to : error on cache writing #201

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version: 2.1.4
PHP version: 5.2.6

What steps will reproduce the problem?
1. load enough javascript/css to reach cache filename length limit

Expected output:
No errors

Actual output:
"Write failed to {cache_dir}"

Did any unit tests FAIL? (Please do not post the full list)
Havent run tests

Please provide any additional information below. 

Cache failed to write when loading too many javascripts. I changed the line 
Minimify.php : 530 : $name = substr($name, 0, 250 - 34 - strlen($prefix));
to
Minimify.php : 530 : $name = substr($name, 0, 200 - 34 - strlen($prefix));

and the problem was gone. Did the cache tried to write a filename bigger then 
the OS limit?

Original issue reported on code.google.com by rud...@gmail.com on 28 Oct 2010 at 1:49

GoogleCodeExporter commented 9 years ago
Thanks, guess I can't trust WP's info on length limitations
http://en.wikipedia.org/wiki/Filename#Comparison_of_file_name_limitations

Original comment by mrclay....@gmail.com on 28 Oct 2010 at 4:20

GoogleCodeExporter commented 9 years ago
Fixed in git master

Original comment by mrclay....@gmail.com on 3 Sep 2011 at 11:22

GoogleCodeExporter commented 9 years ago
Not the best solution.
I have a long path to my /www dir (on windows).
And that length limitation wasn't enough, maybe related to total path length.
changed to: "100 - 34 - strlen($prefix)"

Original comment by izi...@gmail.com on 14 Dec 2012 at 2:52