Perfect- thanks Luiz.

As an example of why this is useful:

*) let's say that you wanted to automatically ftp the results of your solve
to a remote server every time you do a solve.
*) You would follow Luiz's advice below, with the os.run line being
os.run('cmd /c ruby ftp_me.rb',1,true)

where ftp_me.rb is

-------------------------------

require 'open-uri'

open("glpk_result.out","r").read(open("ftp://username:passw...@host:port/remote_glpk_result.out";,
:proxy=>"http://proxyhost:proxyport";).write)
------------------------------------------------

Then after every solve, the file gets automatically transferred. Nifty!

Cheers
Yaron




On Thu, Jul 30, 2009 at 4:16 PM, Luiz M. M. Bettoni <
[email protected]> wrote:

>  Hello, Yaron.
>
> One way to do that you want is using the properties files and some Lua
> script.
> In Gusek, select "Options" > "Open User Options File".
> Paste the following four lines:
>
> command.go.$(file.patterns.gmpl)= dostring \
>  if ("$(opnout)"~="") then scite.Open("$(opnout)") end \
>  if ("$(opnbnd)"~="") then scite.Open("$(opnbnd)") end \
>  os.run('cmd /c mybatch.bat',1,true)
>
> NOTES:
> 1. The "mybatch.bat" file MUST reside in the same model folder or in your
> path.
>
> 2. Please note that this will affect EVERY ".mod" file that you run in your
> machine.
> Even if it is a glpk sample (not a good practice, ya?). To avoid this, you
> can use
> the "Local Options File" besides. It will create a "SciTE.properties" file
> in the folder
> of the active model, and the change will affect only models in this same
> folder.
>
> If you have interest, you can read more about SciTE and make better changes
> =)
>
>
> Regards,
> Luiz
>
>
>
> Yaron Kretchmer escreveu:
>
> Thanks Luiz.
> Can I change the gusek properties so that when I press the "Go" (shoes)
> button
>      1) glpsol.exe will be run
>      2) After glpsol finishes, the batch.bat file is run
>
> If this is possible, how do I do it?
>
> Thanks
> Yaron
>
>
> On Thu, Jul 30, 2009 at 1:45 PM, Luiz Bettoni <
> [email protected]> wrote:
>
>> Hi, Yaron.
>>
>> Gusek was made like a fork of the SciTE editor dedicated to GLPK.
>> So, you can use SciTE native resources like:
>>
>> A) Edit / include menus to run external tools /scripts
>> (http://www.scintilla.org/SciTEFAQ.html#ToolsMenu)
>> See gmpl.properties: Menu options -> open gmpl.properties
>>
>> B) Use Lua Scripting
>> See http://www.scintilla.org/SciTELua.html
>>
>> C) Directly run batch files
>> Open a batch file in Gusek then "run" it.
>> For example: you can run a custom batch file from Gusek,
>> calling glpsol.exe to solve your model, and then performing another tasks,
>> like this:
>>
>> glpsol.exe --cuts -m "test.mod"
>> call mybatch.bat
>> delete *.tmp
>>
>> The batch output will be show in the Gusek output pane.
>>
>> Tip: you can use GMPL to generate dynamic batch files too, echoing
>> commands like below, and call them from another batch file.
>>
>> param myfile symbolic := "test.bat";
>> printf "echo off\n" > myfile;
>> printf "echo Hello, there!\n" >> myfile;
>> printf "pause\n" >> myfile;
>> end;
>>
>> Wish this tips helps.
>>
>> Regards!
>> Luiz
>>
>>
>> Yaron Kretchmer escreveu:
>>
>> Luiz-
>> Here's a Gusek question for you: Can I specify a post-processing script
>> (like a shell script ) that will be run once Gusek is done solving?
>>
>> Regards from California
>>
>> Yaron
>>
>>
>> ---------- Forwarded message ----------
>> From: Yaron Kretchmer <[email protected]>
>> Date: Thu, Jul 30, 2009 at 10:36 AM
>> Subject: Gusek question
>> To: [email protected]
>>
>>
>> Hi There.
>> I'd like to run a post-processing script (i.e. some shell script of
>> windows batch) after GLPK has been run, so as the results are better
>> formatted. Is there a hook in Gusek to do that?
>>
>> Thanks
>> Yaron
>>
>>
>>
>
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to