Hi,
I always thought system.pathForFile performs concatenation only, unless called for ResourceDirectory, where it also checks if file exists.
Well I was trying to solve an issue in code when I found that the path length has limitation.
If I try to create a path for a file with path longer than 128 characters, it will return nil.
Simple test:
local path128 = "/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789123456/123456.789" local path129 = "/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789/123456789123456/123456.7890" local newpath128 = system.pathForFile(path128, system.DocumentsDirectory) local newpath129 = system.pathForFile(path129, system.DocumentsDirectory) print(newpath128, newpath129)
I am not sure whether this is a bug or a limitation?
Workaround for me is to do:
print(system.pathForFile(nil, system.DocumentsDirectory) .. path129)