ftp
ftp copied to clipboard
Add Stat based on MLST command
Hi,
The idea of this new method is provide a more efficient way to lookup a single entry when supported by the remote server.
I exposed a new ErrNotSupported error to ease the detection of an unsupported method & implement a fallback strategy.
There is a subtle difference between MLST and MLSD, the former has a space in front of each line entry (except BEGIN/END), I was not sure if the trim should be done here or in parseRFC3659ListLine.
I'm not sure if Stat is the appropriate name though, it matches the commonly used os.Stat() function but there is a STAT FTP command (that does something else entirely.)
Very useful thank you :-)
Coverage decreased (-1.8%) to 72.326% when pulling 30f31b98d5ce502ff5063bdc3208d73ad32810ee on cogniteev:add-mlst-command into dfa1e758f3afefbee42e95d49116bff8e1e536bc on jlaffaye:master.
Can you please add a test case for this new function ? Also, I agree, we should come with a better name since Stat is confusing.
Could be GetEntry, GetEntryInfo, ..
For the test there are none for the ftp.go file thus I'm not quite sure how to bootstrap one, I'll try to get a look if I got the time.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Would GetEntryInfo be fine?
Dup: https://github.com/jlaffaye/ftp/pull/269