|
piziliu2004
中级用户
   过度热情
积分 321
发帖 139
注册 2006-3-21
状态 离线
|
『楼 主』:
怎样在一个ftp上搜索到我想找的文件或文件夹
使用 LLM 解释/回答一下
怎样在一个ftp上搜索到我想找的文件或文件夹?。用脚本,工具都可。
如题。
How to search for the file or folder I want on an FTP? Scripts or tools can be used.
|

知识在于不断积累 |
|
2007-5-8 09:50 |
|
|
piziliu2004
中级用户
   过度热情
积分 321
发帖 139
注册 2006-3-21
状态 离线
|
|
2007-5-8 10:49 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
|
2007-5-8 13:23 |
|
|
lililulula
中级用户
  
积分 302
发帖 138
注册 2007-3-29
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
echo open ip>1.txt
echo username>>1.txt
echo password>>1.txt
echo ls>>1.txt
echo bye>>1.txt
ftp -s:1.txt>1.log
findstr /b /e /c:"donghua" 1.log>2.txt && goto :cd
goto :eof
:cd
for /f "delims=" %%i in (2.txt) do set fdname=%%i
echo open ip>1.txt
echo username>>1.txt
echo password>>1.txt
echo cd %fdname%>>1.txt
ftp -s:1.txt
上面主要是完成了每次登陆ftp都登陆楼主所要登陆的文件夹
xp下经过测试成功,不过存在2点问题
1,如果是要查找中文文件名的话是不可以的,ftp下ls出的目录名是中文的话会用其他表示,不知道是不是ftp服务器设置的问题
2,只能查找ftp登入后根目录下的目录名,如果所希望的目录是在目录中的字目录的话则无法完成,例如donghua目录在ftp "根目录\123\donghua"的话,就找不到了,ftp里面dir的参数无效,所以不知道怎么查找指定目录所有子目录类似dir /s的功能
Last edited by lililulula on 2007-5-8 at 02:21 PM ]
echo open ip>1.txt
echo username>>1.txt
echo password>>1.txt
echo ls>>1.txt
echo bye>>1.txt
ftp -s:1.txt>1.log
findstr /b /e /c:"donghua" 1.log>2.txt && goto :cd
goto :eof
:cd
for /f "delims=" %%i in (2.txt) do set fdname=%%i
echo open ip>1.txt
echo username>>1.txt
echo password>>1.txt
echo cd %fdname%>>1.txt
ftp -s:1.txt
The above mainly completes the process of logging in to the folder that the owner wants to log in to each time when logging in to FTP. It was tested successfully under XP, but there are 2 problems:
1. If you want to find a Chinese file name, it is not possible. If the directory name listed by ls under FTP is in Chinese, it will be represented in other ways. I don't know if it is a problem with the FTP server settings.
2. It can only find the directory name in the root directory after FTP login. If the desired directory is in a subdirectory of the directory, it cannot be completed. For example, if the donghua directory is in "root directory\123\donghua" of FTP, it cannot be found. The parameter of dir in FTP is invalid, so I don't know how to find all subdirectories of a specified directory similar to the function of dir /s.
Last edited by lililulula on 2007-5-8 at 02:21 PM ]
|
|
2007-5-8 14:12 |
|
|
piziliu2004
中级用户
   过度热情
积分 321
发帖 139
注册 2006-3-21
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
to: lililulula
先谢了阿。!。 关键是需要遍历搜索FTP的目录下所有的子目录,望各位多多讨论。
to vkill
.你说的是p-ftpls.BAT 把, 你写的那个. 我还不知道具体怎么用你写的批处理参数。
能发个例子参考参考一下, 实现寻找一个文件(遍历搜索FTP的目录下所有的子目录)
to: lililulula
Thanks in advance.!.. The key is to traverse and search all subdirectories under the FTP directory. Hope everyone can discuss more.
to vkill
.You mean the p-ftpls.BAT, I don't know how to use the parameters of the batch file you wrote specifically.
Can you send an example for reference, to achieve finding a file (traversing and searching all subdirectories under the FTP directory)
|

知识在于不断积累 |
|
2007-5-8 15:57 |
|
|
546474
中级用户
  
积分 247
发帖 123
注册 2007-4-17
状态 离线
|
|
2007-5-8 16:05 |
|
|
piziliu2004
中级用户
   过度热情
积分 321
发帖 139
注册 2006-3-21
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
剛才下載了p-ftpls.BAT -s.試用了一下. 感覺需要時間好長好長.,能不能有時間稍微短一點的阿
Just downloaded p-ftpls.BAT -s. Tried it out. It feels like it takes a really long time. Is there a way to make it a bit shorter in time?
|

知识在于不断积累 |
|
2007-5-8 16:24 |
|
|
lililulula
中级用户
  
积分 302
发帖 138
注册 2007-3-29
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
看了下vkill的p-ftpls.bat 彻底扑灭了我的希望,不过对于楼主的要求的话倒是可以实现了,先利用p-ftpls 遍历出所有目录导出文本,然后用批来执行后面需要的操作.
I took a look at vkill's p-ftpls.bat and it completely dashed my hopes, but for the requirements of the thread starter, it can actually be achieved. First, use p-ftpls to traverse all directories and export to a text file, then use a batch script to perform the subsequent operations needed.
|
|
2007-5-8 16:47 |
|
|
piziliu2004
中级用户
   过度热情
积分 321
发帖 139
注册 2006-3-21
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
我遍历了一个ftp花了我20几分钟。晕。 不知道各位之不知道有现成的软件用(vc,vb,.net等开发的软件)。我想用那些高级软件可能处理遍历要快些。
I spent more than 20 minutes traversing an FTP. Oh my. I don't know if you guys know if there are ready-made software (software developed with VC, VB, .NET, etc.). I want to use those advanced software which might handle traversal faster.
|

知识在于不断积累 |
|
2007-5-8 17:19 |
|
|
piziliu2004
中级用户
   过度热情
积分 321
发帖 139
注册 2006-3-21
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
我遍历了一个ftp花了我20几分钟。晕。 不知道各位之不知道有现成的软件用(vc,vb,.net等开发的软件)。我想用那些高级软件可能处理遍历要快些。
I spent more than 20 minutes traversing an FTP. Oh my. I don't know if you guys know if there are ready-made software (software developed with VC, VB, .NET, etc.). I think using those advanced software might handle traversal faster.
|

知识在于不断积累 |
|
2007-5-9 11:42 |
|
|
qingfushuan
高级用户
   
积分 502
发帖 327
注册 2006-12-30
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
LZ的标题没得限制在cmd下,如果是windows可以用flashfxp试试
The title of LZ has no restrictions in cmd. If it's Windows, you can try using flashfxp.
|
|
2007-5-9 12:10 |
|