File date/time?

1 view
Skip to first unread message

Ron Jeffries

unread,
Mar 14, 2011, 4:23:01 AM3/14/11
to iLuaBox
is there a way to get the date and time of a file? Looking through io
and os, I don't see one.

Thanks!

Tom Skwara

unread,
Mar 14, 2011, 11:54:35 AM3/14/11
to ilu...@googlegroups.com
No way in the current version :(

Good news however:  a new [built-in] toolbox is on its way called LFS Toolbox!

The Lua File System Toolbox offers access to the underlying iLuaBox directory structure and file attributes.  Included are:

  • File attributes (i.e. time of access, modification, etc.)
  • File locking, unlocking, touching
  • Directory create, remove, change current, lock, unlock
  • A few extras...

This should also help with your earlier request relative to version control :)
 

Tom Skwara
MobileApp Systems



Ron Jeffries

unread,
Mar 14, 2011, 2:19:43 PM3/14/11
to ilu...@googlegroups.com
Hello, Tom. On Monday, March 14, 2011, at 11:54:35 AM, you wrote:

> Good news however: a new [built-in] toolbox is on its way called LFS Toolbox!

> The Lua File System Toolbox offers access to the underlying
> iLuaBox directory structure and file attributes. Included are:

> File attributes (i.e. time of access, modification, etc.)
> File locking, unlocking, touching
> Directory create, remove, change current, lock, unlock
> A few extras...

Great news ... is it time to start holding our breath yet? :)

Ron Jeffries
www.XProgramming.com
Working in a team room reduces significant interruptions
by making most interruptions very insignificant.

Tom Skwara

unread,
Mar 14, 2011, 2:58:17 PM3/14/11
to ilu...@googlegroups.com
v1.2.1 is still in review [ugh...]

The version following 1.2.1 contains at least the following:

- LFS Toolbox (built-in)
- Speech Toolbox (In-App purchase)
- Customizable keyboard shelf (iPad only)

While I don't advise holding ones breath [just yet], these features are complete!  Docs are now getting some fit-and-finish...

Tom Skwara
MobileApp Systems


dave

unread,
Mar 15, 2011, 9:57:51 AM3/15/11
to iLuaBox
Tom;

Will there be anything to allow writing to / reading from a memory
card plugged into the iPad.

Dave.
> > by making most interruptions very insignificant.- Hide quoted text -
>
> - Show quoted text -

Tom Skwara

unread,
Mar 16, 2011, 8:31:55 AM3/16/11
to ilu...@googlegroups.com
Only access to the Documents directory of iLuaBox's sandbox is permitted [at this time].
This is a backed up directory.

Tom Skwara
MobileApp Systems



ronjeff...@gmail.com

unread,
Mar 16, 2011, 9:22:40 AM3/16/11
to ilu...@googlegroups.com
Backed up? What does this mean to the likes of me? Can we recover from it? What and how?

Thanks,

R


Tom Skwara

unread,
Mar 16, 2011, 9:44:58 AM3/16/11
to ilu...@googlegroups.com
iTunes backup/restore will include files in an applications 'Documents' directory.

Tom Skwara
MobileApp Systems



Ron Jeffries

unread,
Mar 16, 2011, 9:54:09 AM3/16/11
to ilu...@googlegroups.com
Hello, Tom. On Wednesday, March 16, 2011, at 9:44:58 AM, you
wrote:

> iTunes backup/restore will include files in an applications
> 'Documents' directory.

Ah, I see. I thought you meant backed up inside iLuabox ... thanks!

Ron Jeffries
www.XProgramming.com
I try to Zen through it and keep my voice very mellow and low.
Inside I am screaming and have a machine gun.
Yin and Yang I figure.
-- Tom Jeffries

Tom Skwara

unread,
Mar 16, 2011, 10:12:14 AM3/16/11
to ilu...@googlegroups.com
Just as a sidebar to backing up, iLuaBox 1.2.1 includes a user data persistence mechanism.  Until that goes up on the App Store, I've included the new 'ilua.lua' file listing below that can be used right now.  Just add a call to 'dofile('ilua.lua') at the end of 'extras.lua' .  Hopefully the file comments are clear enough, but feel free to ask questions.

Tom Skwara
MobileApp Systems



-- ilua.lua

-- This file is executed with the global "ilua" table already defined

-- serialization support function
function ilua.basicSerialize (o)
  if type(o) == "number" then
    return tostring(o)
  else   -- assume it is a string
    return string.format("%q", o) end
end

-- save a table to current I/O stream
function ilua.saveTable (name, value, saved)
  saved = saved or {}                 -- initial value
  io.write(name, " = ")
  if type(value) == "number" or type(value) == "string" then
    io.write(ilua.basicSerialize(value), "\n")
  elseif type(value) == "table" then
    if saved[value] then              -- value already saved?
      io.write(saved[value], "\n")    -- use its previous name
    else
      saved[value] = name             -- save name for next time
      io.write("{}\n")                -- create a new table
      for k,v in pairs(value) do      -- save its fields
        k = ilua.basicSerialize(k)
        local fname = string.format("%s[%s]", name, k)
        ilua.saveTable(fname, v, saved)
      end
    end
  else
    error("cannot save a " .. type(value))
  end
end

-- Users can add fields to 'ilua._DATA' table
-- as-needed for perstistent storage between sessions.
-- Supported types include number, string, and table.
-- User must call 'ilua.saveData' function to save data
-- as a script file named 'data.lua'.  The 'ilua._DATA'
-- table  is recreated by calling 'ilua.loadData' or by
-- simply executing 'data.lua'. 
function ilua.saveData()
  ilua._DATA = ilua._DATA or {}
  local f = io.open("data.lua", "w")
  io.output(f)          -- prepare to write
  io.write("-- data.lua\n\n")
  ilua.saveTable("ilua._DATA", ilua._DATA)
  f:close()
  io.output(io.stdout)  -- restore stdout
end

-- load the ilua._DATA table from file 'data.lua' 
function ilua.loadData()
  local f = io.open("data.lua", "r")
  if f == nil then      -- does file exist?
    ilua.saveData()     -- create if necessary
  else
    f:close()           -- close existing file
  end
  io.input(io.stdin)    -- restore stdin
  dofile("data.lua")    -- run the script
end

-- instantiate ilua._DATA table from file 'data.lua'
ilua.loadData()
Reply all
Reply to author
Forward
0 new messages