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
|