ruby - How to only read a few lines from a remote file? -


before downloading file, need set way (the .csv typically, not always) parsed.

i don't want download whole file if "headers" not match expected.

is there way download until number of byes , gracefully kill connection?

there's no explicit support in ftp protocol.

there's expired draft rang command allow this:
https://tools.ietf.org/html/draft-bryan-ftp-range-08
that's supported new ftp servers.


though there's nothing prevents initiating normal (full) download , forcefully break amount of data need.

all need close data transfer connection. ftp clients do, when end user decides abort transfer.

this approach might result in few error messages in ftp server log.


if can use sftp protocol, it's easy. sftp supports natively.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -