diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 13:26:06 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 13:26:06 +0000 |
commit | 8c038f4b24750a0bc8d365f132fc7c43b8d2ec2b (patch) | |
tree | e4da5c3123dc6e7d56ca1018733d3c6c578c1a7d | |
parent | afacda9ac42ddd7128cbf65091b0f6aeb0c743cb (diff) | |
download | acf-core-8c038f4b24750a0bc8d365f132fc7c43b8d2ec2b.tar.bz2 acf-core-8c038f4b24750a0bc8d365f132fc7c43b8d2ec2b.tar.xz |
Change modelfunctions.getfiledetails to use size=actual size, not filesize=user friendly size
-rw-r--r-- | app/filedetails-html.lsp | 2 | ||||
-rw-r--r-- | lib/modelfunctions.lua | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/filedetails-html.lsp b/app/filedetails-html.lsp index 2dd90e5..59c6a91 100644 --- a/app/filedetails-html.lsp +++ b/app/filedetails-html.lsp @@ -14,7 +14,7 @@ htmlviewfunctions.displayinfo(form) header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="File Details"}), page_info, htmlviewfunctions.incrementheader(header_level)) htmlviewfunctions.displayitem(form.value.filename) -htmlviewfunctions.displayitem(form.value.filesize) +htmlviewfunctions.displayitem(form.value.size) htmlviewfunctions.displayitem(form.value.mtime) if form.value.grep and form.value.grep.value and form.value.grep.value ~= "" then htmlviewfunctions.displayitem(form.value.grep) diff --git a/lib/modelfunctions.lua b/lib/modelfunctions.lua index 2819911..3345dce 100644 --- a/lib/modelfunctions.lua +++ b/lib/modelfunctions.lua @@ -82,9 +82,9 @@ end function mymodule.getfiledetails(file, validatefilename, validatefiledetails) local filename = cfe({ value=file or "", label="File name" }) local filecontent = cfe({ type="longtext", label="File content" }) - local filesize = cfe({ value="0", label="File size" }) + local size = cfe({ value="0", label="File size" }) local mtime = cfe({ value="---", label="File date" }) - local filedetails = cfe({ type="group", value={filename=filename, filecontent=filecontent, filesize=filesize, mtime=mtime}, label="Config file details" }) + local filedetails = cfe({ type="group", value={filename=filename, filecontent=filecontent, size=size, mtime=mtime}, label="Config file details" }) local success = true if type(validatefilename) == "function" then success = validatefilename(filedetails.value.filename.value) @@ -103,10 +103,10 @@ function mymodule.getfiledetails(file, validatefilename, validatefiledetails) end if success then if fs.is_file(file) then - local filedetails = fs.stat(file) + local filedetails = posix.stat(file) filecontent.value = fs.read_file(file) or "" - filesize.value = filedetails.size - mtime.value = filedetails.mtime + size.value = format.formatfilesize(filedetails.size) + mtime.value = format.formattime(filedetails.mtime) else filename.errtxt = "File not found" end |