lua - How do I save directory information from os.execute("dir") into a string? -


is possible save directory info obtained os.execute("dir") string form?

so in directory <dell> have files info.txt , readme.txt. want use os.execute("dir") , have files info.txt , readme.txt saved string dir. guess entire string read dell; info.txt, readme.txt.

no, using io.popen should work.

io.popen (prog [, mode])

this function system dependent , not available on platforms.

starts program prog in separated process , returns file handle can use read data program (if mode "r", default) or write data program (if mode "w").

local p = io.popen( "dir", "r" ) local output = p:read "*a" p:close( ) -- , use output 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -