digitalmars.D.learn - FTP LS
- Anonymouse (5/5) May 14 2022 Before I go on duplicating effort, does anyone have anything that
- rikki cattermole (2/2) May 14 2022 Phobos curl wrapper may be an option:
- ikod (2/7) May 14 2022 It should. Maybe get ftp://path/ . Will check a bit later.
- ikod (8/16) May 14 2022 Yes, it should. If you get("ftp://hostname/path/") it will try to
- ikod (6/11) May 14 2022 or I can implement this with http method HEAD. If this is ok -
- ikod (27/32) May 15 2022 Added LIST command in v2.0.8
- Anonymouse (2/3) May 15 2022 Thanks!
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.
May 14 2022
Phobos curl wrapper may be an option: https://dlang.org/phobos/std_net_curl.html#.FTP
May 14 2022
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.
May 14 2022
On Saturday, 14 May 2022 at 10:17:14 UTC, ikod wrote:On Saturday, 14 May 2022 at 08:42:46 UTC, Anonymouse wrote: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 πΊπ¦!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.
May 14 2022
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 πΊπ¦!
May 14 2022
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 ftp 35 May 12 09:00 TIMESTAMP drwxrwxr-x 9 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-x 6 ftp ftp 92 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 πΊπ¦!
May 15 2022
On Sunday, 15 May 2022 at 19:13:10 UTC, ikod wrote:Added LIST command in v2.0.8Thanks!
May 15 2022