[Cuis-dev] OSProcess standard output
Jon Raiford
raiford at labware.com
Thu Mar 19 10:55:47 PDT 2026
Hilaire,
I had a look through my Cuis directories and didn't find the code I wrote to launch a process and capture the stdout. This was done in the very early days of me playing with Cuis so it is likely lost to time. I think it was a simple case of calling popen(), fgets(), and pclose() but in some structured way.
Yes, the FFI documentation has improved quite a bit recently. It's definitely worth giving it a go if you are interested. I don't know if the docs have everything yet. For instance, there were some changes recently to allow calling GetLastError() or fetch the errno variable as an atomic operation with the FFI call (technically you can have it call any function or fetch any shared variable). This avoids some annoying issues where the vm calls another function before your code has a chance to fetch the error information. Ping if you need any help. We have lots of FFI code now we could pull examples from.
Jon
From: Hilaire Fernandes <hfern at free.fr>
Date: Wednesday, March 18, 2026 at 4:09 PM
To: Jon Raiford <raiford at labware.com>, Discussion of Cuis Smalltalk <cuis-dev at lists.cuis.st>
Subject: Re: [Cuis-dev] OSProcess standard output
Hi Jon,
Thanks for the insights.
I have been using OSProcess to convert PDF document to a readable format within Cuis. The external software suite I am using is poppler-utils and its pdftocairo utility with command like:
pdftocairo -r {1} -jpeg -jpegopt quality=90 -f {2} -l {3} {4}/import.pdf {4}/page
This software is linked to various libraries and I guess those ones can be directly called with FFI. I have no prior experience with that though.
I should do that at some point. The Cuis documentation about FFI seems to be quite complete.
Hilaire
Le 17/03/2026 à 13:58, Jon Raiford a écrit :
Hi Hilaire,
I ran into this problem as well and implemented it via FFI. It's much lighter weight than the full OSProcess package (that I only learned about after I implemented it). This was from a few years ago. I'll see if I can find it. If not, it is quite simple to call into the glibc library for both functions and shared variables.
--
http://mamot.fr/@drgeo<http://mamot.fr/@drgeo>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260319/14ed9b57/attachment.htm>
More information about the Cuis-dev
mailing list