lua如何从全路径中获取文件名(linux、windows通用)

lua如何从全路径中获取文件名(linux、windows通用),急!!!!! 分享到:

第1个回答  2013-08-04
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
第2个回答  2013-09-05
着急!!!
pcct_1.txt_20110120_20130704172172534.bak
pcct_1.txt_20110120_20130703172172534.bak
pcct_1.txt_20110120_20130905172172534.bak
pcct_1.txt_20110120_20130905272182534.bak
pcct_1.txt_20110120_20130703172172534.bak
......
要取其中一个文件的第21~28位中最大的那个文件.求指点.
不要那么复杂。怎么实现。
第3个回答  2013-08-04
可以用,十分感谢!
相似回答