<?php /** *@param rc_ip: rc server_ip *@param app_key: application key *@param local ip : local ip */ $tfsobj = new tfs_client($argv[1], $argv[2], $argv[3]); echo "\n-------------------\n"; $app_id = $tfsobj->get_app_id(); $uid = 100; $dir_path = "/"; echo "\n app_id: {$app_id}\n"; echo "\n------------create dir case------------\n"; //$tfsobj->create_dir($uid, $dir_path); $file_path = "/tkkk22222kkkkkk"; $tfsobj->create_file($uid, $file_path); echo "\n------------open file case------------\n"; $fd = $tfsobj->fopen($app_id, $uid, $file_path, 4); echo "\nfd: {$fd}\n"; echo "\n------------write file case------------\n"; $data = 'XXXXXXXXXXXX'; $data_len = strlen($data); $ret = $tfsobj->pwrite($fd, $data, $data_len, 0); echo "\n write data ret: {$ret}\n"; echo "\n------------read file case------------\n"; $ret = $tfsobj->pread($fd, $data_len, 0); echo "\n read data ret: length : {$ret['0']}, data: {$ret['1']}\n"; echo "\n------------rm file case------------\n"; $ret = $tfsobj->rm_file($uid, $file_path); echo "\nrm_file case ret: {$ret}------------\n";