Hi,


But I have one more quastion. Using os.execute I'cant see the program
output. Is it possible to see the results returned by "put" command ?

Redirect STDOUT to a file, and read it.

        os.execute('put "foo.txt" > c:/windows/temp/out.txt')
        local f = io.open('c:/windows/temp/out.txt')
        local out = f:read('*all')
        print(out)
        f:close()

If you want to capture STDERR if there is an error,
        os.execute('put "foo.txt" 1> c:/windows/temp/out.txt 2>&1')
should work.

Take care,
-Mitchell;



On 6/11/07, April White <[EMAIL PROTECTED]> wrote:
Bambero wrote:
> I made a simple shell script which uploads (to ftp server) curently
> open file.
> I'm using:
>
> command.name.3.*=FTP put
> command.3.*=put "$(FilePath)"
> command.subsystem.3.*=0
> command.mode.3.*=savebefore:1
>
> but it will be nice to do this command after each save.

How familiar are you with the Lua interface?  The Lua/SciTE interface
has an event OnSave() which is merely a Lua script function that is
automatically called after a file has been saved.  I have not dabbled
with the Lua / SciTE interface for quite a long time, I may be rusty here.

You would have something like:

function OnSave()
    os.execute("put \"" .. props.FilePath .. "\"");
    return false;
end

os.execute() does a simple shell swap to run the program given as the
parameter to it.
props.FilePath is a Lua means to retrieve a SciTE property.  If the
property have spaces or periods in its name use props[ "its.name.here" ]
The \" embeds a quote inside the string

April
--

Illiterate? Write for help

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest


_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to