Initializer

init(forUpdatingAtPath:)

Returns a file handle initialized for reading and writing to the file, device, or named socket at the specified path. 指定されたパスでのファイル、デバイス、または名前付きソケットの読み書きのために初期化されるファイルハンドルを返します。

Declaration 宣言

convenience init?(forUpdatingAtPath path: String)

Parameters パラメータ

path

The path to the file, device, or named socket to access. アクセスするファイル、デバイス、または名前付きソケットへのパス。

Return Value 戻り値

The initialized file handle object or nil if no file exists at path. 初期化されたファイルハンドルオブジェクトまたは、pathでファイルが存在しないならばnil

Discussion 議論

The file pointer is set to the beginning of the file. The returned object responds to both read... messages and write(_:). ファイルポインタは、ファイルの始まりに設定されます。返されるオブジェクトはread...メッセージとwrite(_:)の両方に応答します。

When using this method to create a file handle object, the file handle owns its associated file descriptor and is responsible for closing it. このメソッドを使ってファイルハンドルオブジェクトを作成する場合、ファイルハンドルは、それの結び付けられたファイル記述子を所有し、そしてそれを閉じることに責任を持ちます。

See Also 参照

Creating a File Handle ファイルハンドルを作成する

Related Documentation 関連文書