A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/ja/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle below:

FileSystemDirectoryHandle.getDirectoryHandle() - Web API | MDN

FileSystemDirectoryHandle.getDirectoryHandle()

Baseline 2023

Newly available

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

FileSystemDirectoryHandle インターフェイスの getDirectoryHandle() メソッドは、このメソッドが呼ばれたディレクトリーハンドル内の指定した名前のサブディレクトリーを表す FileSystemDirectoryHandle を返します。

構文
getDirectoryHandle(name)
getDirectoryHandle(name, options)
引数
name

取得したいサブディレクトリーの FileSystemHandle.name を表す文字列です。

options 省略可

取得するサブディレクトリーに関するオプションを持つオブジェクトで、省略可能です。以下のオプションがあります。

create

boolean 値で、デフォルトは false です。true に設定すると、ディレクトリーが見つからない場合、指定した名前のディレクトリーが作成されて返されます。

返値

FileSystemDirectoryHandle で解決する Promise を返します。

例外
NotAllowedError DOMException

PermissionStatus が 'granted' でないとき投げられます。

TypeMismatchError DOMException

返されるエントリーがファイルで、ディレクトリーではないとき投げられます。

NotFoundError DOMException

ディレクトリーが存在せず、create オプションが false に設定されているとき投げられます。

例

以下の例では、指定した名前のディレクトリーハンドルを返します。ディレクトリーが存在しない場合、作成されます。

const dirName = "directoryToGetName";

// ディレクトリーハンドル 'currentDirHandle' があると仮定
const subDir = currentDirHandle.getDirectoryHandle(dirName, { create: true });
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4