Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/FTP/Kotlin/ftp.kotlin
Normal file
18
Task/FTP/Kotlin/ftp.kotlin
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Kotlin Native v0.6
|
||||
|
||||
import kotlinx.cinterop.*
|
||||
import ftplib.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val nbuf = nativeHeap.allocPointerTo<netbuf>()
|
||||
FtpInit()
|
||||
FtpConnect("ftp.easynet.fr", nbuf.ptr)
|
||||
val vnbuf = nbuf.value
|
||||
FtpLogin("anonymous", "ftptest@example.com", vnbuf)
|
||||
FtpOptions(FTPLIB_CONNMODE, FTPLIB_PASSIVE.toLong(), vnbuf)
|
||||
FtpChdir("/debian/", vnbuf)
|
||||
FtpDir(null, ".", vnbuf)
|
||||
FtpGet("ftp.README", "README.html", FTPLIB_ASCII.toByte(), vnbuf)
|
||||
FtpQuit(vnbuf)
|
||||
nativeHeap.free(nbuf)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue