code_junkie

wxLua: upload files with wxFtp

Nov 13th, 2011
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. local ftp = wx.wxFTP()
  2. local ftpAddress = wx.wxIPV4address()
  3. ftpAddress:Service( "ftp" )
  4. ftpAddress:Hostname( "ftp.example.com" )
  5. ftp:Connect( ftpAddress )
  6. local out1 = ftp:GetOutputStream( "foo" )
  7. out1:Close()
  8. local out2 = ftp:GetOutputStream( "bar" )
  9. out2:Close() -- here out2 is nil
  10.  
  11. local ftp = wx.wxFTP()
  12. local ftpAddress = wx.wxIPV4address()
  13. ftpAddress:Service( "ftp" )
  14. ftpAddress:Hostname( "ftp.example.com" )
  15. ftp:Connect( ftpAddress )
  16. local out1 = ftp:GetOutputStream( "foo" )
  17. out1 = nil
  18. collectgarbage("collect") -- force full garbage collection
  19. local out2 = ftp:GetOutputStream( "bar" )
  20. out2 = nil
  21. collectgarbage("collect")
Add Comment
Please, Sign In to add comment