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

2025-05-12 04:09:19
推荐回答(1个)
回答1:

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