ITempFileSystemService Methods
public interface ITempFileSystemService{ public abstract TempFile CreateTempFile( string? fileName = null) { // ... }}Parameters
fileNamestring?optionalOptional file name for the temporary file (e.g., "config.json", "script.sh"). If null, uses a random name.Remarks
This method creates a new temporary file. If a file name is specified, it creates a temporary subdirectory and places the file with that name inside it. If no file name is specified, it uses Path.GetTempFileName. Dispose the returned object to delete the file.
Use this instead of calling Path.GetTempFileName directly.
public interface ITempFileSystemService{ public abstract TempDirectory CreateTempSubdirectory( string? prefix = null) { // ... }}Parameters
prefixstring?optionalOptional prefix for the subdirectory name (e.g., "aspire").Returns
TempDirectoryA TempDirectory representing the created temporary subdirectory. Dispose to delete.Remarks
This method creates a unique temporary subdirectory using the system temp folder. The directory is created immediately. Dispose the returned object to delete the directory.
Use this instead of calling Directory.CreateTempSubdirectory directly.