From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../ja/web/api/filesystemdirectoryentry/index.html | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 files/ja/web/api/filesystemdirectoryentry/index.html (limited to 'files/ja/web/api/filesystemdirectoryentry') diff --git a/files/ja/web/api/filesystemdirectoryentry/index.html b/files/ja/web/api/filesystemdirectoryentry/index.html new file mode 100644 index 0000000000..ffe1561740 --- /dev/null +++ b/files/ja/web/api/filesystemdirectoryentry/index.html @@ -0,0 +1,107 @@ +--- +title: FileSystemDirectoryEntry +slug: Web/API/FileSystemDirectoryEntry +tags: + - API + - File API + - File System API + - File and Directory Entries API + - FileSystemDirectoryEntry + - Files + - Interface + - NeedsMarkupWork + - Non-standard + - Offline + - Reference +translation_of: Web/API/FileSystemDirectoryEntry +--- +
{{APIRef("File System API")}}{{SeeCompatTable}}
+ +

FileSystemDirectoryEntryFile and Directory Entries API のインターフェイスで、ファイルシステム内のディレクトリを表します。これはディレクトリ内のファイルにアクセスして操作する方法と、ディレクトリ内のエントリにアクセスする方法を提供します。

+ +

基本概念

+ +

{{domxref("FileSystemDirectoryEntry.getDirectory", "getDirectory()")}} を呼び出して新しいディレクトリを作成することができます。サブディレクトリを作成する場合は、各子ディレクトリを順番に作成します。まだ存在しない親ディレクトリを含むフルパスを使用してディレクトリを作成しようとすると、エラーが返されます。したがって、親ディレクトリを作成した後、新しいパスを再帰的に追加して階層を作成します。

+ +

+ +

次のコードスニペットでは、 "Documents" というディレクトリを作成します。

+ +
// Taking care of the browser-specific prefixes.
+window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+window.directoryEntry = window.directoryEntry || window.webkitDirectoryEntry;
+
+...
+
+function onFs(fs){
+  fs.root.getDirectory('Documents', {create:true}, function(directoryEntry){
+    //directoryEntry.isFile === false
+    //directoryEntry.isDirectory === true
+    //directoryEntry.name === 'Documents'
+    //directoryEntry.fullPath === '/Documents'
+
+    }, onError);
+
+  }
+
+// 一時記憶装置でファイルシステムを開く
+window.requestFileSystem(TEMPORARY, 1024*1024 /*1MB*/, onFs, onError);
+ +

プロパティ

+ +

このインターフェイスは独自のプロパティを持っていませんが、親インターフェイス {{domxref("FileSystemEntry")}} からプロパティを継承しています。

+ +

メソッド

+ +

このインターフェイスは、親インターフェイスである {{domxref("FileSystemEntry")}} からメソッドを継承しています。

+ +
+
{{domxref("FileSystemDirectoryEntry.createReader", "createReader()")}}
+
このディレクトリ内のエントリを読み込むために使用できる {{domxref("FileSystemDirectoryReader")}} オブジェクトを作成します。
+
{{domxref("FileSystemDirectoryEntry.getDirectory", "getDirectory()")}}
+
メソッドが呼び出されるディレクトリを基準に、指定されたパスにあるディレクトリを表す {{domxref("FileSystemDirectoryEntry")}} オブジェクトを返します。
+
{{domxref("FileSystemDirectoryEntry.getFile", "getFile()")}}
+
メソッドが呼び出されるディレクトリに対する相対パスを指定して、ディレクトリの階層内にあるファイルを表す {{domxref("FileSystemFileEntry")}} オブジェクトを返します。
+
+ +

廃止されたメソッド

+ +
+
{{domxref("FileSystemDirectoryEntry.removeRecursively", "removeRecursively()")}}
+
サブディレクトリのコンテンツを含むディレクトリとそのすべてのコンテンツを削除します。これは仕様から削除されました。
+
+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様書ステータスコメント
{{SpecName('File System API', '#api-directoryentry', 'FileSystemDirectoryEntry')}}{{Spec2('File System API')}}
+ +

ブラウザの互換性

+ + + +

{{Compat("api.FileSystemDirectoryEntry")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf