Some servers seem to send a blank line at the end of an MLST response.
MLST Download
250-
Size=53248;Modify=20230327134339.000;Type=dir; Download
250 Requested file action okay, completed.
Before this change this would cause the GetEntry method to return this
error.
unsupported LIST line
This patch ignores blank lines in the MLST response.
* Add MLST command in the form of a Get method
The `LIST` and `MLSD` commands are inefficient when the objective
is to retrieve one single `Entry` for a known path, because the only way
to get such an entry is to list the parent directory using a data
connection. The `MLST` fixes this by allowing one single `Entry` to be
returned using the control connection.
The name `Get` was chosen because it is often used in conjunction with
`List` as a mean to get one single entry.
Signed-off-by: Thomas Hallgren <thomas@datawire.io>
* Changes in response to code review:
- Rename `Get` to `GetEntry` (because it returns an `*Entry`)
- Add test-case for multiline response on the control connection
- Fix issues with parsing the multiline response.
Signed-off-by: Thomas Hallgren <thomas@datawire.io>
* Add sample output from MLST to GetEntry comment.
Signed-off-by: Thomas Hallgren <thomas@datawire.io>
* Changes in response to code review:
- Remove unused `time.Time` argument
- Add struct labels to make `govet` happy
Signed-off-by: Thomas Hallgren <thomas@datawire.io>
* Remove time arg when calling parseNextRFC3659ListLine
Signed-off-by: Thomas Hallgren <thomas@datawire.io>
Signed-off-by: Thomas Hallgren <thomas@datawire.io>
Listing a current directory (when the path argument is empty)
would send the command "LIST " with trailing whitespace to FTP
resulting in 500 errors with Solaris FTP server.
This patch fixes that.