メインコンテンツまでスキップ
Version: Fegg 5.x

File::moveFile

ファイルを移動(名前を変更)します

説明​

public bool File::moveFile( string $from, string $to )

rename()で$fromを$toに移動します。$fromがない場合や、移動できない場合はfalseを返します。

引数​

名前データ型デフォルト備考
$fromstring移動元のファイル
$tostring移動先のファイル

例​

Controller
use Fegg\Tool\File;

$file = new File();
$file->moveFile('path/to/foo.txt', 'path/to/bar.txt');