You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So if you try to store a file keyed by something like file://localhost/Users/peyton/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/DA12CB50-EA95-479D-BC14-7A01A68914B3/Documents/CameraCache/9EE8E76D-41A9-4226-974A-38D298F8971A-48969-00000C866AB57336.gif, TMDiskCache will fail silently. After URL encoding, the filename is waaay too long.
Inside <sys/syslimits.h>, there's NAME_MAX, the maximum length of the last component of a path, and PATH_MAX the absolute limit on path length.
I leave it to you to decide what to do.
The text was updated successfully, but these errors were encountered:
How long is "too long"? I'm trying to find the root cause of my app's TMCache crash issues, but I'm not finding this to be a problem. I ran a test on TMCache to this effect in which I take the key passed into TMCache and make it 18x longer via
Then I logged out the byte size of each key being used. I got the following results, with no failures nor crashing:
fetching a 1800 byte long key
fetching a 1818 byte long key
fetching a 1800 byte long key
setting a 1908 byte long key
setting a 1710 byte long key
setting a 1890 byte long key
fetching a 1440 byte long key
fetching a 1440 byte long key
setting a 1818 byte long key
setting a 4986 byte long key
setting a 1440 byte long key
setting a 1674 byte long key
setting a 1818 byte long key
setting a 1800 byte long key
fetching a 1908 byte long key
fetching a 1710 byte long key
You can see these are exceptionally long keys, with one that is about 5K, let alone the file path it uses for storage. TMCache didn't flinch on any of these. Testing was done on-device (iPhone 6+, iOS 8.1.2)
So if you try to store a file keyed by something like
file://localhost/Users/peyton/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/DA12CB50-EA95-479D-BC14-7A01A68914B3/Documents/CameraCache/9EE8E76D-41A9-4226-974A-38D298F8971A-48969-00000C866AB57336.gif
, TMDiskCache will fail silently. After URL encoding, the filename is waaay too long.Inside
<sys/syslimits.h>
, there'sNAME_MAX
, the maximum length of the last component of a path, andPATH_MAX
the absolute limit on path length.I leave it to you to decide what to do.
The text was updated successfully, but these errors were encountered: