Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/FTP/FutureBasic/ftp.basic
Normal file
30
Task/FTP/FutureBasic/ftp.basic
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
#plist NSAppTransportSecurity @{NSAllowsArbitraryLoads:YES}
|
||||
|
||||
local fn RunTerminalCommand( cmd as CFStringRef ) as CFStringRef
|
||||
CFStringRef outputStr = NULL
|
||||
|
||||
TaskRef task = fn TaskInit
|
||||
TaskSetExecutableURL( task, fn URLFileURLWithPath( @"/bin/zsh" ) )
|
||||
CFStringRef cmdStr = fn StringWithFormat( @"%@", cmd )
|
||||
CFArrayRef args = fn ArrayWithObjects( @"-c", cmdStr, NULL )
|
||||
TaskSetArguments( task, args )
|
||||
|
||||
PipeRef p = fn PipeInit
|
||||
TaskSetStandardOutput( task, p )
|
||||
TaskSetStandardError( task, p )
|
||||
FileHandleRef fh = fn PipeFileHandleForReading( p )
|
||||
|
||||
fn TaskLaunch( task, NULL )
|
||||
TaskWaitUntilExit( task )
|
||||
|
||||
ErrorRef err
|
||||
CFDataRef dta = fn FileHandleReadDataToEndOfFile( fh, @err )
|
||||
if err then NSLog( @"%@", fn ErrorLocalizedDescription( err ) ) : exit fn
|
||||
outputStr = fn StringWithData( dta, NSUTF8StringEncoding )
|
||||
end fn = outputStr
|
||||
|
||||
NSLog( @"%@", fn RunTerminalCommand( @"curl ftp://ftp.slackware.com/welcome.msg" ) )
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue