Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,12 @@
window 1, @"Calendar", (0, 0, 520, 520 )
Str255 a
open "UNIX", 1,"cal 1969"
do
line input #1, a
print a
until eof(1)
close 1
HandleEvents

View file

@ -0,0 +1,17 @@
include "NSLog.incl"
local fn RunCommand( command as CFStringRef ) as CFStringRef
TaskRef tsk = fn TaskInit
TaskSetExecutableURL( tsk, fn URLFileURLWithPath( @"/bin/sh" ) )
TaskSetArguments( tsk, @[@"-c",command] )
PipeRef pip = fn PipeInit
TaskSetStandardOutput( tsk, pip )
FileHandleRef fh = fn PipeFileHandleForReading( pip )
fn TaskLaunch( tsk, NULL )
CFDataRef dta = fn FileHandleReadDataToEndOfFile( fh, NULL )
CFStringRef outputStr = fn StringWithData( dta, NSUTF8StringEncoding )
end fn = outputStr
NSLog( @"%@", fn RunCommand( @"cal 1969" ) )
HandleEvents