FTP: Difference between revisions

Content added Content deleted
m (→‎{{header|php}}: -> header|PHP, pre tags)
No edit summary
Line 609: Line 609:
ftp:close(Pid).
ftp:close(Pid).
</lang>
</lang>



=={{header|FutureBasic}}==
FB for Mac easily interfaces with the terminal commandline.
<lang futurebasic>
include "NSLog.incl"

#plist NSAppTransportSecurity @{NSAllowsArbitraryLoads:YES}

local fn RunTerminalCommand( cmd as CFStringRef ) as CFStringRef
'~'1
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
</lang>
{{output}}
<pre>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 754 100 754 0 0 1363 0 --:--:-- --:--:-- --:--:-- 1361

---------------------------------------------------------------------------
R S Y N C . O S U O S L . O R G
Oregon State University
Open Source Lab

Unauthorized use is prohibited - violators will be prosecuted
---------------------------------------------------------------------------

For more information about the OSL visit:
http://osuosl.org/services/hosting

This host is the home to the primary archives of several
projects. We would prefer that only primary/secondary
mirrors use this service. Thanks!

---------------------------------------------------------------------------
</pre>






=={{header|Go}}==
=={{header|Go}}==
Line 674: Line 742:
fmt.Println("Wrote", n, "bytes to", file)
fmt.Println("Wrote", n, "bytes to", file)
}</lang>
}</lang>




=={{header|Groovy}}==
=={{header|Groovy}}==