[Gllug] Controlling ftp from a program/commandline

Alistair Mann gllug at lgeezer.net
Thu Sep 30 23:56:21 UTC 2010


salsaman at xs4all.nl wrote:
>  Hi, I am trying to do something like this:
>
>  $ mkfifo fifo $ ftp ftp.example.com < fifo
>
>  $ echo username > fifo $ echo passwd > fifo
>
>
>  but actually from within a C program. The problem is it doesn't work,
>  ftp seems to need the username and password from an actual terminal.
>
>
>  I can't do e.g:
>
>  ftp < script.file because the commands for ftp are generated at
>  runtime.
>
>  Any suggestions how to get it to do what I want, i.e write to the
>  stdin of ftp ?

Would ftp be happy using the username and password via ~/.netrc instead?

Cheers,
-- 
Alistair Mann

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list