method

gettextfile

v2_2_9 - Show latest stable - Class: Net::FTP
gettextfile(remotefile, localfile = File.basename(remotefile))
public

Retrieves remotefile in ASCII (text) mode, storing the result in localfile. If localfile is nil, returns retrieved data. If a block is supplied, it is passed the retrieved data one line at a time.

2Notes

writes the file to disk even if you pass a block

ColinDKelley · Jun 17, 2010

I was surprised to find that the local file is opened and written even if you pass the block. If you're local working directory isn't writeable or doesn't have the space, you're out of luck.

nope

Alex2222 · Mar 2, 2017

If you pass nil as local file, it doesn't write the file and only returns the content as string.