lua中根据文件名 获取文件的绝对路径

例如IOS越狱系统中lua中要寻找的文件为1.txt,如何获取文件所在的绝对路径!

第1个回答  推荐于2016-10-16
fn_flag = string.find(filename, "\\")if fn_flag thendest_filename = string.match(filename, ".+\\([^\\]*%.%w+)$")endfn_flag = string.find(filename, "/")if fn_flag thendest_filename = string.match(filename, ".+/([^/]*%.%w+)$")end更多详见 http://blog.csdn.net/bull_liu/article/details/8726089本回答被提问者采纳
相似回答