OS calls to Linux

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

OS calls to Linux

Louis LaBrunda
Hi Linux gurus,

Are there Linux equivalents of these classes OSStartupinfo, OSProcessInformation and OSCall?  And are there Linux equivalents of these  methods osCall>createProcess:lpszCommandLine:lpsaProcess:lpsaThread:fInheritHandles:fdwCreate:lpvEnvironment:lpszCurDir:lpsiStartInfo:lppiProcInfo:, osCall>getLastError and processInfo hProcess waitForSingleObject: -1.
exitCodeBytes := ByteArray new: 4.
processInfo hProcess getExitCodeProcess: exitCodeBytes.
processInfo hProcess closeHandle.
processInfo hThread closeHandle.
lastProgramExitCode := exitCodeBytes int32At: 0.

Big picture.  I use these to run a program on windows from my VA Smalltalk Seaside app.  I would like to run the same Seaside app on Linux and start the Linux version of the same program.  I am developing in windows and would like to avoid installing the VA Smalltalk dev env on Linux for as long as I can.

Thanks, Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/JSQr-eORTe0J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: OS calls to Linux

Louis LaBrunda
Hi Linux gurus,

As I'm trying to start a program in Linux, I thought I would look around a UNIX XD image for AbtProgramStarter which my windows code for starting a program without it opening a windows was based upon.  I found the UNIX version of AbtProgramStarter but its #runCshCmd: method doesn't compile because UNIXProcess>execute:input:output:error:environment: doesn't compile and if you keep looking it gets worse from there.

Am I missing something?  Is there something I need to load?  I'm developing in windows to deploy in Linux, so I may not have everything setup correctly.

Thanks, Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/0JF-_2TZHW8J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: OS calls to Linux

Thomas Koschate-2
Louis, what version are you running?  UNIXProcess changed in 8.0.1 because it was dependent on having the C shell installed, which is not a normal condition for most current UNIX systems.  If you're running an older version of VA, you'll either need to backport a newer UNIXProcess, or make sure that C shell is installed.

Tom

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/_w9j55ww9QQJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: OS calls to Linux

Louis LaBrunda
Hi Tom,

I running version 8.0.3.  What I'm seeing may just be because I'm loading things into an UNIX XD image and then looking around.  The missing methods worry me.

But I would think that I could create a new UNIX XD image with "External Calls" (and "Communications -TCP/IP") set and then look at AbtProgramStarter and not see a compile error in #startProgram.

Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/RoaH1753bNYJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: OS calls to Linux

Thomas Koschate-2
Are you loading the XD image under Windows?  I see a problem with AbtProgramStarter>>#startProgram and its send to #runCshCmd: there, but the same isn't true if I create an XD image in UNIX and look at it there.  I don't think it's anything to worry about.  During the UNIX image startup, all the application loaded and startUp methods are called, which is not the case when preparing an XD image.  Also, as I recall, by default, no methods are removed when an XD image is packaged, unless explicitly excluded.

Tom

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/N7q4rnjJ5sgJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: OS calls to Linux

Louis LaBrunda
Hi Tom,

Thanks for the help.  Yes, I am working/developing in Windows.  I want to use AbtProgramStarter or at least something like it.  I am developing in Windows (a Seaside app) but plan to deploy it to Linux.

I think as you say that all should be okay.  I need the function of AbtProgramStarter to start wkhtmltopdf that can convert html/css into a PDF file. If anyone is interested it can be found here: http://code.google.com/p/wkhtmltopdf/.  It should run on Windows and Linux (I've tested it on Windows). It is run as a command line program. You give it a URL or html input filename and an output pdf filename (where it writes the pdf file).

I have taken the guts of the Windows version AbtProgramStarter to start the program without opening a window.  Now I have taken the guts of the UNIX version to run the program and wait for it to finish.  The original UNIX code doesn't wait.

I think I have everything right but can't tell for sure until I can package it up and test it under Linux.

Thanks, Lou

P.S.  wkhtmltopdf looks pretty good.  It is based upon Apples Safari web browser.  It seems to generate a nice PDF copy of my web reports.  I use one base CSS file for the screen and add another "Printer Friendly" CSS file to paint the screen in a more printer friendly way.  When I want a PDF file I use the printer friendly CSS file and capture the html before it would go to the browser.  Then I send it to wkhtmltopdf, read its output PDF file and send it to the browser.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/CdkzYQdoCo8J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.