<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 18px; color: rgb(0, 0, 0);">Hilaire,</span></p>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><br>
</span></p>
<p style="direction: ltr; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">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. </span></p>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jon</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div id="mail-editor-reference-message-container" style="color: inherit; background-color: inherit;">
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr;">
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>Hilaire Fernandes <hfern@free.fr><br>
<b>Date: </b>Wednesday, March 18, 2026 at 4:09 PM<br>
<b>To: </b>Jon Raiford <raiford@labware.com>, Discussion of Cuis Smalltalk <cuis-dev@lists.cuis.st><br>
<b>Subject: </b>Re: [Cuis-dev] OSProcess standard output<br>
<br>
</div>
<p class="ms-outlook-mobile-reference-message skipProofing"><span style="font-size: 18px;">Hi Jon, </span></p>
<p class="ms-outlook-mobile-reference-message skipProofing"><span style="font-size: 18px;">Thanks for the insights.</span></p>
<p class="ms-outlook-mobile-reference-message skipProofing"><span style="font-size: 18px;">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:</span></p>
<p class="ms-outlook-mobile-reference-message skipProofing"><span style="font-size: 18px;">pdftocairo -r {1} -jpeg -jpegopt quality=90 -f {2} -l {3} {4}/import.pdf {4}/page</span></p>
<p class="ms-outlook-mobile-reference-message skipProofing"><span style="font-size: 18px;">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.</span></p>
<p class="ms-outlook-mobile-reference-message skipProofing"><span style="font-size: 18px;">I should do that at some point. The Cuis documentation about FFI seems to be quite complete.</span></p>
<p class="ms-outlook-mobile-reference-message skipProofing"><span style="font-size: 18px;">Hilaire</span></p>
<div class="moz-cite-prefix">Le 17/03/2026 à 13:58, Jon Raiford a écrit :</div>
<blockquote>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Hilaire,</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
</blockquote>
<pre><div class="moz-signature">--
<a href="http://mamot.fr/@drgeo" class="moz-txt-link-freetext" data-outlook-id="b005da23-3ce7-49bf-aa28-e73867b43d54">http://mamot.fr/@drgeo</a></div></pre>
</div>
</body>
</html>