-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cs 4.1使用cross c2写插件时bls命令无法正常运行 #81
Comments
|
我这边又测试了一下发现好像不是上传的原因,上传是没有问题的(其实确实是被切割了,比如9m的文件确实会先切割上传,然后没上传完就执行后面的命令了),但是前面不管是什么命令都无法调用后面的file_exists,比如只调用bcd不调用upload同样不能正常调用file_exists,改为bupload_raw同理,如果将后面的file_exists换成println就能正常执行,但是不会等到上传结束,而是立刻执行
by the way其实我最终想实现的就是在文件上传完成前不执行后面的语句,因此才想出自己实现一个判断文件是否存在并持续递归,直到上传完成再执行后面的命令,我看了官方文档好像没有判断文件是否存在的方法,本来想利用bshell将ls的结果保存到一个tmp.txt,再通过cna脚本去读来实现查找文件是否存在,但是似乎官网也没有直接读文件的函数,您有什么好的建议么,感谢您百忙之中的回复 |
bls的回调是可以获取到文件的详细信息的,比如大小,日期之类的,可以通过这个来判断文件是否存在或者说文件是否上传完毕。
|
linux所使用的bupload_raw()是非阻塞的,目前没法解决,鉴于该问题需要调用bupload的阻塞特性,下个版本会考虑支持此函数。 |
上述该问题已解决,且bupload函数也已添加 |
环境 cs4.1 cross c2
编写如下判断文件是否存在函数
$filename_linux = "prf-linux";
$filepath = "/tmp/"
sub file_exists {
println($bid);
bls($bid, $filepath, lambda({
if (indexOf($3, $filename) != 0) {
println($filename . " exists");
} else {
println($filename . " not exists");
}
}));
}
通过下面函数调用可正常判断文件是否存在
file_exists($bid, $filepath);
但是如果在调用该函数前调用其他函数,就不能正常执行了,比如
file_exists($bid, $filepath);
就只能调用cd命令和upload,但是file_exists没反应了,跟了一下发现file_exists也调用了,但是bls没有跑起来
但是同样的命令在windows下可以正常运行
The text was updated successfully, but these errors were encountered: