コード例 #1
0
ファイル: test_meta.php プロジェクト: hltj/tfs
$ret = $tfsobj->rm_dir($uid, $dir_path);
echo "\nrm dir case ret: {$ret}------------\n";
echo "\n------------mv dir case------------\n";
$dir_path = "/test_dir_100000003200010";
$dir_path1 = "/test_dir_2000000320010";
$ret = $tfsobj->create_dir($uid, $dir_path1);
$ret = $tfsobj->mv_dir($uid, $dir_path1, $dir_path);
echo "\nmv dir case ret: {$ret}------------\n";
$ret = $tfsobj->rm_dir($uid, $dir_path);
echo "\n------------fstat case------------\n";
$file_path = "/test_file_stat";
$tfsobj->create_file($uid, $file_path);
$fd = $tfsobj->fopen($app_id, $uid, $file_path, 4);
$data = 'XXXXXXXXXXXX';
$data_len = strlen($data);
$ret = $tfsobj->pwrite($fd, $data, $data_len, 0);
$ary = $tfsobj->fstat($tfsobj->get_app_id(), $uid, $file_path);
echo "\n fstat ret: {$ary['0']}, {$ary['1']}, {$ary['2']} =====\n";
$ret = $tfsobj->rm_file($uid, $file_path);
echo "\n------------ls dir case------------\n";
$dir_path = "/t1ss";
$tfsobj->create_dir($uid, $dir_path);
$tfsobj->create_dir($uid, $dir_path . "/test1");
$tfsobj->create_dir($uid, $dir_path . "/test2");
$tfsobj->create_dir($uid, $dir_path . "/test3");
$ary = $tfsobj->ls_dir($tfsobj->get_app_id(), $uid, $dir_path);
echo "\n ls dir ret: {$ary['0']}, {$ary['1']}, {$ary['2']}------------\n";
$ret = $tfsobj->rm_dir($uid, $dir_path . "/test1");
$ret = $tfsobj->rm_dir($uid, $dir_path . "/test2");
$ret = $tfsobj->rm_dir($uid, $dir_path . "/test3");
$ret = $tfsobj->rm_dir($uid, $dir_path);