humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
Changelog
clear_directory
clear_directory($server,$dir_name,$timeout=3000); - FTPФункция на вход принимает параметры:
:
Пример использования
<?php // Scenario: Clear a directory on WebDAV server by removing all files and subdirectories $xhe_host = getenv("RPABOT_HOST_URL"); if (!isset($path)) { // Path to the init.php file for connecting to the XHE API $path = "../../../Templates/init.php"; // Including init.php grants access to all classes and functionality for working with the XHE API require($path); } // Start echo "\n<font color=blue>webdav->" . basename(__FILE__) . "</font>\n"; // Account credentials $server = "https://webdav.yandex.ru"; $login = "xxx@yandex.ru"; $password = "xxx"; // Step: Connect to WebDAV server echo "1. Connect to server: " . $server . " : "; $connectResult = WEB::$webdav->connect($server, $login, $password); echo $connectResult . "\n"; // Step: Create test directory structure with files echo "2. Create test directory structure on server: "; $createDirResult = WEB::$webdav->create_directory($server, "test_clear"); $putFileResult1 = WEB::$webdav->put_file($server, "test/put_test.txt", "test_clear/test.txt", true); $createSubDirResult = WEB::$webdav->create_directory($server, "test_clear/test_level_2"); $putFileResult2 = WEB::$webdav->put_file($server, "test/put_test.txt", "test_clear/test_level_2/test.txt", true); echo $createDirResult . " " . $putFileResult1 . " " . $createSubDirResult . " " . $putFileResult2 . "\n"; // Pause sleep(4); // Example 1: Clear directory echo "\n\nExample 1: Clear directory\n"; $directoryPath = "test_clear"; echo "3. Clear directory: "; $clearResult = WEB::$webdav->clear_directory($server, $directoryPath); echo $clearResult . "\n"; // Step: Disconnect from all servers echo "4. Disconnect from all servers: "; $disconnectResult = WEB::$webdav->disconnect_all(); echo $disconnectResult . "\n"; // End echo "\n"; // Quit the application WINDOW::$app->quit();
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7028" from xweb_human_emulator import * # начало echo("<hr><font color=blue>ftp.xxxxxxxxx</font><hr>") # аккаунт server = "https://webdav.yandex.ru"; login = "xxx@yandex.ru"; password = "xxx"; # 1 echo("1. Соединится с сервером : "+server+" : "); echo(webdav.connect(server,login,password),"<br>"); # 2 echo("2. Создать папку на фтп : "); echo(webdav.create_directory(server,"test_clear")," "); echo(webdav.put_file(server,"test\\put_test.txt","test_clear/test.txt",true)," "); echo(webdav.create_directory(server,"test_clear/test_level_2")," "); echo(webdav.put_file(server,"test\\put_test.txt","test_clear/test_level_2/test.txt",true),"\n"); # пауза sleep(4); # 3 echo("3. Очистим папку : "); echo(webdav.clear_directory(server,"test_clear"),"<br>"); # 4 echo("4. Отсоединится от всех серверов : "); echo(webdav.disconnect_all()); # конец echo("<hr><br>") # Quit app.quit()
#region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program:XHEScript { static void Main(string[] args) { // init XHE XHEScript.server = Environment.GetEnvironmentVariable("RPABOT_HOST_URL"); InitXHE(); // начало echo("<hr><font color=blue>ftp.remove_directory</font><hr>"); // аккаунт var server = "https://webdav.yandex.ru"; var login = "xxx@yandex.ru"; var password = "xxx"; // 1 echo("1. Соединится с сервером : "+server+" : "); echo(webdav.connect(server,login,password)+"<br>"); // 2 echo("2. Создать папку на фтп : "); echo(webdav.create_directory(server,"test_clear")+" "); echo(webdav.put_file(server,"test\\put_test.txt","test_clear/test.txt",true)+" "); echo(webdav.create_directory(server,"test_clear/test_level_2")+" "); echo(webdav.put_file(server,"test\\put_test.txt","test_clear/test_level_2/test.txt",true)+"\n"); // пауза sleep(4); // 3 echo("3. Очистим папку : "); echo(webdav.clear_directory(server,"test_clear")+"<br>"); // 4 echo("4. Отсоединится от всех серверов : "); echo(webdav.disconnect_all()); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7028"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>ftp.remove_directory</font><hr>"); // аккаунт server = "https://webdav.yandex.ru"; login = "xxx@yandex.ru"; password = "xxx"; // 1 echo("1. Соединится с сервером : "+server+" : "); echo(webdav.connect(server,login,password)+"<br>"); // 2 echo("2. Создать папку на фтп : "); echo(webdav.create_directory(server,"test_clear")+" "); echo(webdav.put_file(server,"test\\put_test.txt","test_clear/test.txt",true)+" "); echo(webdav.create_directory(server,"test_clear/test_level_2")+" "); echo(webdav.put_file(server,"test\\put_test.txt","test_clear/test_level_2/test.txt",true)+"\n"); // пауза app.sleep(4); // 3 echo("3. Очистим папку : "); echo(webdav.clear_directory(server,"test_clear")+"<br>"); // 4 echo("4. Отсоединится от всех серверов : "); echo(webdav.disconnect_all()); // конец echo("\n"); // Quit app.quit();
=============================================
webdav Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.