The eccoMAGIC Forums
http://forums.eccoMAGIC.com/forum/YaBB.pl the SLANG EXTENSION and Guest Programming >> Slang Rules Scripts, Functions, Examples and HOW TO >> starting a background program via LUA with os.execute - locks file http://forums.eccoMAGIC.com/forum/YaBB.pl?num=1197546813 Message started by ykorovin on 12/13/07 at 05:53:33 |
Title: starting a background program via LUA with os.execute - locks file Post by ykorovin on 12/13/07 at 05:53:33 Start works, but one problem left - when the background program is running, i can not save the file - it is locked (Can't write to file, cause unknown). The starting LUA script function startcmd() x = get_select_items() title = get_item_text(x[1]) -- msgbox(title) os.execute ("kill eccocmd" ) os.execute ("start /min /low eccocmd.exe /C seccount.bat " .. title ) end What i want by this - to launch an indicator counting seconds i'm spending on the selected item. To check how this works add files to eccopro program directory copy cmd.exe as eccocmd.exe kill.exe (attached) create seccount.bat : for /L %%i in (1,1,999) do ( sleep 1 title %%i %1 %2 %3 %4 ) Select an item, launch LUA - MSDOS window will start minimised, showing seconds counter and the 4 first words of item in the title. The kill.exe is to kill previous item counter, to have one item at a time |
Title: Re: starting a background program via LUA with os.execute - locks file Post by Admin on 12/16/07 at 08:55:13 solution: emSPAWN (Freeware). see http://forums.eccomagic.com/forum/YaBB.pl?num=1197818365 or, use the windows command 'start' to start your command in another shell and immediatly give back control to your script (works great and only slightly less elegant (pops open cmd window for second before completion) Code:
helps ? |
Title: Re: starting a background program via LUA with os.execute - locks file Post by ykorovin on 12/17/07 at 00:10:11 HELPS!!! the new code is itemnew = get_select_items() title = get_item_text(itemnew[1]) os.execute ("kill eccocmd" ) os.execute ("emSpawn.exe start /min /low eccocmd.exe /C seccount.bat " .. title ) thanks!!! |
Title: Re: starting a background program via LUA with os.execute - locks file Post by Admin on 12/17/07 at 09:35:20 just to note, os.execute ("emSpawn.exe start /min /low eccocmd.exe /C seccount.bat " .. title ) is creating a thired process thread (with defined characteristics). This is good if desired, but not necessary if not desired. ie. os.execute ("emSpawn.exe eccocmd.exe /C seccount.bat " .. title ) or even os.execute ("emSpawn.exe /! eccocmd.exe /C seccount.bat " .. title ) should also work... |
The eccoMAGIC Forums » Powered by YaBB 2.1! YaBB © 2000-2005. All Rights Reserved. |