Results 1 to 7 of 7
well im totally new in linux (today started), i was trying create a new folder from a Lua console with the function os.execute() i ve done it in window without ...
- 02-09-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 3
mkdir from Lua
well im totally new in linux (today started), i was trying create a new folder from a Lua console with the function os.execute() i ve done it in window without problems, i already tried many ways, also executing the same commands from PuTTY works fine.
from lua tries
os.execute("mkdir testfolder")
os.execute("cd /home/myname ; mkdir testfolder")
os.execute("mkdir home/myname/testfolder")
none works but using PuTTY they works fine =/
of course the lua console is running in the linux host.
please any help
- 02-09-2010 #2
In linux C programming , mkdir() function will create a directory.
something like
I don't know about Lua. Can you invoke mkdir() from Lua? check thatmkdir"/path/to/dir",077);- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 02-09-2010 #3Just Joined!
- Join Date
- Feb 2010
- Posts
- 3
- 02-09-2010 #4
I don't have experience on Lua, a quick google gave me this ,
os.execute and bash environment variables - scite-interest | Google Groups
HTH- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 02-09-2010 #5
- 02-09-2010 #6
ha ha...<i cannot post urls>
looks like you are strictly following forums rules
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 02-09-2010 #7Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,116
Hi.
I am not a good enough typist to use the interactive mode, so from a script:
this produces:Code:#!/usr/bin/env lua -- @(#) l1 Demonstrate feature. print("Hello World") os.execute("ls") dirname = "scratch" os.execute("mkdir " .. dirname) os.execute("ls")
That small snippet -- mkdir -- also worked interactively.Code:% ./s1 Hello World s1 s1 scratch
Copied from Programming in Lua : 22.2 ... cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )


Reply With Quote

