CloseCachedFileAsync(string, JobHandle)
Closes a file held open internally by the AsyncReadManager.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: Unity.IO.LowLevel.Unsafe
- Assembly: UnityEngine.CoreModule
public static JobHandle CloseCachedFileAsync(string fileName, JobHandle dependency = default)
Parameters
Returns
Type | Description |
|---|---|
| JobHandle | A JobHandle that completes when the asynchronous close operation finishes. |
Remarks
The AsyncReadManager has an internal cache of up to 10 open files, so use this method if you experience a sharing violation when trying to access one of these files that is held open.
Notes:
- Do not use this method for files opened with AsyncReadManager.OpenFileAsync, as these files do not go into the AsyncReadManager's file cache. Use FileHandle.Close instead.
- On Windows and Xbox platforms, this method has no effect as cached files are not maintained for these platforms.