0

I want to write a cocoa application that checks if my ftp server is still up and running. So far I learned that CFFTP could be used but this is not object oriented code so a no go for me. Also some people recommend ConnectionKit but that won't build on 10.7. So my idea was to use terminal commands in my application with the help of NSTask. The problem is: there are multiple commands that need to be executed, the first being ftp ftp.foobar.com. Then I need to check if the response is ok or not. After that I will have to put in my username and password and also evaluate that output of that.

Does anyone know how the entire ftp connection handshake can be accomplished in Objective C via NSTask?

Monolo
  • 18,205
  • 17
  • 69
  • 103
ChristophMa
  • 129
  • 2
  • 2
  • 6

1 Answers1

0

You could run

ftp -N /path/to/a/netrcfile

and try to parse the output.

I agree with @Rob Keniger in the comments, though - why not go for the C API? I am sure there is plenty of sample code out there to learn[*] from.

[*] Read: copy, then try to figure out why it does what it does

Monolo
  • 18,205
  • 17
  • 69
  • 103