プラットフォームをまたいでファイルにアクセスするには、@'Stride.Core.IO.VirtualFileSystem' を使用することをお勧めします。この静的クラスは、ファイルの読み込み、書き込み、コピー、存在確認、削除などの基本的な操作をすべて提供します。
[!Note] パスの区切り文字は
/です(Unix/Linux の規約)。 <!--[!Note] The path separator is / (Unix/Linux convention).
-->
// VirtualFileSystem でファイルを開く
var gamesave1 = VirtualFileSystem.OpenStream("/roaming/gamesave001.dat", VirtualFileMode.Open, VirtualFileAccess.Read);
// あるいは、ファイルシステムプロバイダ(マウントポイント)を介して、同じファイルに直接アクセスすることもできます。
var gamesave2 = VirtualFileSystem.ApplicationRoaming.OpenStream("gamesave001.dat", VirtualFileMode.Open, VirtualFileAccess.Read);
| マウントポイント | 説明 | 書き込み | クラウド | 備考 | PC | Android | iOS | Windows Phone 8.1
| ----------- | -------------| -------- | ----- | -------| ---- | -------- | ------- | --
| data | パッケージによってデプロイされたアプリケーションデータ | ✗ | ✗ | | <出力ディレクトリ>/data | APK 自身 | デプロイされたパッケージのディレクトリ | InstalledLocation.Path
| binary | ッケージによってデプロイされたアプリケーションバイナリ | ✗ | ✗ | 通常は app_data と同じ(Androidを除く) | アセンブリディレクトリ | アセンブリディレクトリ | アセンブリディレクトリ | アセンブリディレクトリ
| roaming | ユーザー固有のデータ(roaming)| ✓ | ✓ | バックアップ | 出力ディレクトリ/roaming, %APPDATA% | $(Context.getFilesDir)/roaming | Library/roaming | Roaming
| local | ユーザーアプリケーションデータ | ✓ | ✓ | バックアップ | 出力ディレクトリ/local | $(Context.getFilesDir)local | Library/local | Local
| cache | アプリケーションキャッシュ | ✓ | ✗ | DLC など。ユーザーが手動で削除する可能性があります(復元、データ消去など)。 | 出力ディレクトリ/cache, do-not-back-up フラグなし | $(Context.getFilesDir)/cache | Library/caches | LocalCache
| tmp | アプリケーション一時データ | ✓ | ✗ | OSが通知なしに削除する可能性があります。 | 出力ディレクトリ/temp, %TEMP%/%APPNAME% | $(Context.getCacheDir) | tmp | Temporary