dofile() can't find file

dofile() can't find file
0.0 0


I’m trying to load a level map that I generated with Tiled. When I call

levelmap = dofile("level1.lua")

I get

cannot open level1.lua: No such file or directory

Even though require() works fine:



You should use full path to invoke dofile().
CCFileUtils::fullPathFromRelativePath() is designed for this.
On android, you can not invoke dofile() directly, because all resources are packed into .apk.


I the same question now.How to get the full path or the full path format?