Re: FTP LS
On Sunday, 15 May 2022 at 19:13:10 UTC, ikod wrote: Added LIST command in v2.0.8 Thanks!
Re: FTP LS
On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and `Request.get`, but seemingly no way to LS. Added LIST command in v2.0.8 ``` α cat source/app.d import std.stdio; import requests; void main() { auto rq = Request(); auto rs = rq.execute("LIST", "ftp://ftp.iij.ad.jp/pub/FreeBSD/";); writeln(rs.responseBody); } /tmp/ttt α dub run Running ttt -rw-rw-r--1 ftp ftp 4259 May 07 2015 README.TXT -rw-rw-r--1 ftp ftp35 May 12 09:00 TIMESTAMP drwxrwxr-x9 ftp ftp 169 Oct 05 2015 development -rw-r--r--1 ftp ftp 2871 May 11 10:00 dir.sizes drwxrwxr-x 22 ftp ftp 8192 May 09 23:00 doc drwxrwxr-x6 ftp ftp92 Jan 10 21:38 ports drwxrwxr-x 12 ftp ftp 237 Feb 06 2021 releases drwxrwxr-x 12 ftp ftp 237 May 05 18:00 snapshots ``` -- Support πΊπ¦!
Re: FTP LS
On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and `Request.get`, but seemingly no way to LS. or I can implement this with http method HEAD. If this is ok - please post issue on github repo. Thanks! -- Support πΊπ¦!
Re: FTP LS
On Saturday, 14 May 2022 at 10:17:14 UTC, ikod wrote: On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and `Request.get`, but seemingly no way to LS. It should. Maybe get ftp://path/ . Will check a bit later. Yes, it should. If you get("ftp://hostname/path/";) it will try to download directory as file and fail. After that it will try to make NLST and will return directory listing. Please note - AFAIK you will receive only names, no size or other file attributes. -- Support πΊπ¦!
Re: FTP LS
On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and `Request.get`, but seemingly no way to LS. It should. Maybe get ftp://path/ . Will check a bit later.
Re: FTP LS
Phobos curl wrapper may be an option: https://dlang.org/phobos/std_net_curl.html#.FTP
FTP LS
Before I go on duplicating effort, does anyone have anything that can access FTP beyond PUT and GET? I need to read file information from a NAS so I know if I should upload a file or not. `dlang-requests` has `Request.post` and `Request.get`, but seemingly no way to LS.