local var y = 40
for fname in dir("/SCRIPTS") do
lcd.drawText(5,y, fname, TEXT_COLOR)
y = y + 20
endChecks the existence of file or directory. If not exist, return nil. If exist, return the object information.
@status current Introduced in 2.5.0
Parameters
path (string) path to the object
Return value
table object info, table elements:
size (number) file size
attrib (number) file attribute flags
time (table) table with last time modified date and times, table elements:
year (number) year
mon (number) month
day (number) day of month
hour (number) hours
hour12 (number) hours in US format
min (number) minutes
sec (number) seconds
suffix (text) am or pm
info = fstat("radio")
if info ~= nil then
if (info.attrib == AM_DIR) then
print("is a directory")
end
size = info.size
time = info.time
end