发帖
充值
 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
1 0

获取指定目录文件的信息

源码分享 2772 1 2023-4-21 05:42:39
function 类_文件_获取文件所有信息(filePath)
  local fileProperties = {}
  local fileInfo = io.popen('stat -c "%n %y %z %s" "' .. filePath .. '"'):read("*all")
  print(fileInfo)

  fileProperties["path"] = filePath
  fileProperties["create_time"] = string.sub(fileInfo, 6, 24)
  fileProperties["modify_time"] = string.sub(fileInfo, 30, 48)
  fileProperties["size"] = string.sub(fileInfo, 54, -1)
  return fileProperties
end

使用道具 举报

2023-10-1 04:14:34
感谢楼主分享
您需要登录后才可以回帖 立即登录
高级模式
返回
源码分享