Автор: Alexyz21
Дата сообщения: 01.01.2016 14:50
WinXPSP(2,3) x86, FAR3.0.4499, NetBox.
Применение far.GetPluginDirList(nil,""), например так:
Код: local function fwrite(s,f) s = s or "" local h,x = io.open(f,"wb"),nil if h then x=h:write(s); io.close(h) end return x end
local function FTime(n)
local ft=win.FileTimeToSystemTime(n)
return string.format("%02d.%02d.%04d %02d:%02d:%02d",ft.wDay,ft.wMonth,ft.wYear,ft.wHour,ft.wMinute,ft.wSecond)
end
local function itemLine(itm)
local line=itm.FileName
local fa=itm.FileAttributes
if fa:match("d") then line=line.."\\" end
if fa:match("e") then line=line..">" end
line=line.."\t"..FTime(itm.LastWriteTime)
line=line.."\t"..itm.FileSize
line=line.."\t"..fa
line=line.."\r\n"
return line
end
Macro {
area="Shell";
key="CtrlShiftZ";
description="DirList: Create directory listing recursively";
action=function()
local s,f,r="",win.GetEnv("TEMP").."\\DirList.txt"
if APanel.Plugin
then r=far.GetPluginDirList(nil,APanel.Path)
else r=far.GetDirList(APanel.Path)
end
if r then
for i=1,#r do s=s..itemLine(r[i]) end
fwrite(s,f)
else
msgbox("DirList","Can't create DirList for this Panel")
end
end;
}