printf() function

IT it at plastipol.com
Wed Mar 2 17:20:07 UTC 2022


Hi Doug,

I know what stdout and stdin intended for. I’m using pipes for passing the output of one unix process as input of another unix process in macOS using pipes.

As now, if you need that omnis interactuates with other software, specially unix commands, you need to write omnis output to a file and later $runapplescript(‘do shell script’….).

I thought that printf() could output to another unix process not only to a file.  It would be wonderful that omnis could pipe an output to another unix process without writting to disk. And could input from another unix process without reading a file.

In any case I don’t see how you can redirect the unix STDOUT to a file from omnis so you can send text using printf() function in omnis.

regards

xavier


> El 2 mar 2022, a las 17:01, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> escribió:
> 
> hi Xavier
> 
> 
> Standard out is a typical unix place to send messages.   I got a better description online for oyu
> 
> 
> Stdout, also known as standard output, is the default file descriptor where a process can write output. In Unix-like operating systems, such as Linux, macOS X, and BSD, stdout is defined by the POSIX standard. Its default file descriptor number is 1. In the terminal, standard output defaults to the user's screen.
> 
> 
> 
> if you are running a headless version of omnis from a command line, ‘printf’ would send the output to the terminal so you can see whats going on — kind of like writing logs.
> 
> you can also assign STDOUT to a physical file (in a bash script), so if you assign STDOUT to a file like ‘logfile’, then you can see all the interactions to the ‘logfile’ for every printf issued.
> 
> helpful in tracing whats gong on in non visual instances of omnis being used as a server.
> 
> 
> you might want to set STDOUT to  ~/Library/Logs/[yourfolder]/logfilenameYYMMDD. etc
> 
> 
> 
> thats what it looks like from the description.   I haven’t used it since we make our own log files else where (from before this might have been a command).
> 
> 
> hope that gives some ideas.
> 
> 
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com
> http://www.artsman.com
> Phone (403) 650-1978
> 
>> On March 2, 2022, at 12:53 AM, IT <it at plastipol.com> wrote:
>> 
>> 
>> Does anyone know what the printf() function can be used for? Its's only for macOS and Linux. From the documentation and my testings I'm unable to understand it practical use. 
>> 
>> printf()
>> 
>> Syntax
>> 
>> printf(string[,newline=ktrue])
>> 
>> Description
>> 
>> Writes the string to standard output followed by a newline character if required (the function is ignored on Windows. Executes on macOS and Linux only).
>> 
>> 
>> regards
>> 
>> xavier
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list