[Gllug] Controlling ftp from a program/commandline

salsaman at xs4all.nl salsaman at xs4all.nl
Fri Oct 1 01:05:12 UTC 2010


On Fri, October 1, 2010 01:56, Alistair Mann wrote:
> 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
>
>

Thanks guys ! A combination of .netrc and popen does exactly what I wanted !


Regards,
Salsaman.


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




More information about the GLLUG mailing list