View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:23 am



Reply to topic  [ 7 posts ] 
 Listing directories in Lua 
Author Message
DRL Developer
DRL Developer
User avatar

Joined: Thu Jun 11, 2009 2:34 pm
Posts: 966
Location: Moscow, Russia
Reply with quote
Post Listing directories in Lua
Is there any way to get the contents of a directory in CC 's Lua? I've tried to do os.execute("dir /b") but it switches window to console and this is totally unacceptable. Thanks in advance :)


Mon Jan 10, 2011 1:46 am
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Listing directories in Lua
Maybe code up your own small program to return a directory listing, then io.popen.


Mon Jan 10, 2011 2:24 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Thu Jun 11, 2009 2:34 pm
Posts: 966
Location: Moscow, Russia
Reply with quote
Post Re: Listing directories in Lua
I guess it will switch windows too. Oh and shipping custom executable with a mod, this is pure evil :oops:


Mon Jan 10, 2011 2:29 am
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Listing directories in Lua
Well then, looks like we have to go down to another level of hell and make a custom library.


Mon Jan 10, 2011 3:22 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Thu Jun 11, 2009 2:34 pm
Posts: 966
Location: Moscow, Russia
Reply with quote
Post Re: Listing directories in Lua
Like DLL or something? Then I'll have to port it to MacOS and maybe Linux. I don't need directories THAT much :)


Mon Jan 10, 2011 3:32 am
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: Listing directories in Lua
Well I know you can read and write files but I don't know about listing directories.


Mon Jan 10, 2011 9:11 am
Profile

Joined: Sun Jul 04, 2010 6:14 pm
Posts: 37
Reply with quote
Post Re: Listing directories in Lua
mail2345 wrote:
Well then, looks like we have to go down to another level of hell and make a custom library.


Truly shipping a custom executable is far worse than simply compiling an external library. You wouldn't even need to do much, simply make a function that runs dir args and returns the output to lua. It wouldn't switch windows.


Mon Jan 10, 2011 2:31 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.059s | 15 Queries | GZIP : Off ]