FileSystemEntry: fullPath プロパティ
fullPath
は FileSystemEntry
インターフェイスの読み取り専用プロパティで、ファイルシステムのルートから項目が表すファイルまでの完全な絶対パスを指定する文字列を返します。
これは、ルートディレクトリーからの相対パスと考えることもでき、"/" を先頭につけて絶対パスとすることもできます。
値
文字列で、項目のフルパスを示します。
例
この例は、ファイルシステムを指定して呼び出される関数を示しています。この関数は、data.json
という名前のファイルに対して FileSystemFileEntry
を取得し、そのフルパスを返します。
js
function gotFileSystem(fs) {
let path = "";
fs.root.getFile(
"data.json",
{ create: true, exclusive: true },
(entry) => {
path = fullPath;
},
handleError(error),
);
return path;
}
ファイルのフルパスが"/data.json"
であることは、私たち自身が見ているので、明らかに、これは多少作為的なものですが、それを知らないシナリオのための概念です。
仕様書
Specification |
---|
File and Directory Entries API # dom-filesystementry-fullpath |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
fullPath |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.