previousSystem::&cat (Previous) (Next) System::tmpdirnext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

System::mktemp

System::mktemp – 一時ファイルあるいは一時ディレクトリを作成する

Synopsis

require_once "System.php";

mixed System::mktemp ( string $args = = null )

Description

一時ファイルあるいは一時ディレクトリを作成します。 この関数で作成したファイルは、スクリプトの実行終了時に削除されます。

Parameter

  • string $args - 引数。

    • prefix - 一時ファイル名の先頭に付加する文字列 (デフォルトは tmp )。

    • -d - ファイルではなく一時ディレクトリを作成します。

    • -t - 一時ファイルあるいは一時ディレクトリが作成される場所。 省略した場合のデフォルト値は、Windows では環境変数 TMP の場所、Unix では環境変数 TMPDIR の場所となります。 これらの値も省略されている場合は、 c:\windows\temp あるいは /tmp が使用されます。

Return value

mixed - 作成されたファイルあるいはディレクトリのフルパス、あるいは FALSE を返します。

Note

This function can be called statically.

Example

mktemp() の使用

<?php
$tempfile 
System::mktemp("prefix");       
$tempdir  System::mktemp("-d prefix");
$tempfile System::mktemp();
$tempfile System::mktemp("-t /var/tmp prefix");
?>
previousSystem::&cat (Previous) (Next) System::tmpdirnext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.