for循环中的system() [英] system() in for loop

查看:112
本文介绍了for循环中的system()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个循环,它将我登录到我的ftp帐户。但是,我需要它反复运行非常快。我的问题是,无论登录是成功还是不成功,它都很慢,因为它必须等待再次登录等。这是我登录的代码:

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号

解决方案

无论何时使用系统命令(),您都可以使用该命令。在这种情况下,登录到服务器。


你可以批量处理这些东西,做一次登录并ftp ftp整个批次吗?


那么我理想的是,不是断开与服务器的连接,继续登录,但是似乎没有运行脚本的ftp命令,除了ftp -s命令,但是我必须断开连接以再次使用它。 />

你是什么意思做一次登录和ftp ftp整个批次?


有什么方法可以ftp你的所有数据使用一个ftp?


你说你有一个循环。


你能不能从循环中累积数据然后一次ftp它?

I am running a loop which logs me into my ftp account. However, I need it to run VERY fast repeatedly. My problem is that, whether the login is successful or unsuccessful, it is quite slow because it has to then wait to login again etc. This is the code just for my login:

Expand|Select|Wrap|Line Numbers

解决方案

Anytime you use the system command() you are at the mercy of the command. In this case, logging onto a server.

Can you batch this stuff up, do one logon and ftp an ftp the entire batch?


Well what I ideally want to do is instead of disconnecting from the server, keep logging on, however there seems to be no ftp command that runs a script except the ftp -s command, but I have to disconnect to use that again.

What do you mean by "do one logon and ftp an ftp the entire batch"?


Is there any way you can ftp all your data using one ftp?

You say you have a loop.

Can you not accumulate the data from the loop and then ftp it one shot?


这篇关于for循环中的system()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆