访问 FTP 服务器上文件的属性

发布于 2024-12-27 11:09:24 字数 411 浏览 3 评论 0原文

我想通过 url ftp.mysite.com 访问 ftp 服务器上名为 AH_store_20120117_00432.csv 的文件的属性。最后修改日期/时间、大小等属性。

我正在从批处理文件访问 ftp 服务器,如下所示:

@echo off
>ftp2.txt Echo open _ftp.mysite.com
>>ftp2.txt Echo username
>>ftp2.txt Echo password
>>ftp2.txt Echo cd dir1\dir2
>>ftp2.txt Echo quit
ftp -s:ftp2.txt

该文件存在于 dir2 中。 可以从上面的代码访问FTP站点,但不能访问文件属性。

请帮忙。 谢谢

I want to access properties of a file named AH_store_20120117_00432.csv at ftp server with url ftp.mysite.com. Properties such as last modified date/time,size, etc.

I am accessing ftp server from batch file as follows:

@echo off
>ftp2.txt Echo open _ftp.mysite.com
>>ftp2.txt Echo username
>>ftp2.txt Echo password
>>ftp2.txt Echo cd dir1\dir2
>>ftp2.txt Echo quit
ftp -s:ftp2.txt

The file is present in dir2.
FTP site can be accessed from above code, but not the file properties.

Kindly help.
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很糊涂小朋友 2025-01-03 11:09:24

命令 dir 获取有关文件的一些信息
对于批处理文件:

@echo off
>ftp2.txt Echo open _ftp.mysite.com
>>ftp2.txt Echo username
>>ftp2.txt Echo password
>>ftp2.txt Echo cd dir1\dir2
>>ftp2.txt Echo dir
>>ftp2.txt Echo quit
ftp -s:ftp2.txt

您将获得包含文件日期的记录列表。记录的格式可能因系统而异(RFC 959 - 文件传输协议)。
例如,Windows FTP 服务器可能会响应:

12-04-11  08:00PM               209665 04a64ad1-33c6-48ec-9931-abcc6445c491
...

Linux 可能会响应:

-rwxrwxrwx   1 owner    group             156 Jan 27  2010 warning.log
...

command dir gets some info about files
For your batch file:

@echo off
>ftp2.txt Echo open _ftp.mysite.com
>>ftp2.txt Echo username
>>ftp2.txt Echo password
>>ftp2.txt Echo cd dir1\dir2
>>ftp2.txt Echo dir
>>ftp2.txt Echo quit
ftp -s:ftp2.txt

You will get a list of the records included date of file. Format of the records may vary widely from system to system (RFC 959 - File Transfer Protocol).
For example Windows FTP server may response:

12-04-11  08:00PM               209665 04a64ad1-33c6-48ec-9931-abcc6445c491
...

Linux may response:

-rwxrwxrwx   1 owner    group             156 Jan 27  2010 warning.log
...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文