Add Temporary Directory to access each platform's temporary folder.
We could add a new TemporaryDirectory static property to FileSystem class
public static string TemporaryDirectory => PlatformTemporaryDirectory
UWP
ApplicationData.Current.TemporaryFolder.Path
iOS
Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments), "..", "tmp")
Android
Android.OS.Environment.DownloadCacheDirectory
The Cache directory is a great place for files that are easily recreated when lost but currently we don't have a way of accessing a directory for temporary files.
Why is System.IO.Path.GetTempPath() not sufficient?
Why is
System.IO.Path.GetTempPath()not sufficient?
I had reservations if all of the Platforms implemented that method as the docs is not clear if it will return the temp directory that will be accessible from the app. I also read somewhere that in iOS, this method is missing?
In Xamarin.iOS
Method System.IO.Path.GetTempPath() is missing.
source
I researched more on this issue and I have found that System.IO.Path.GetTempPath() really does the job. Will be closing this issue now. Thanks!
Here is a good breakdown of where all standard system.io paths go: https://github.com/dotnet-ad/Standard.SpecialFolders