TemporaryFileHelper class

namespace: Serenity.IO   assemblySerenity.Net.Core

Contains helper functions for temporary files and folders

public class TemporaryFileHelper

Public Members

name description
TemporaryFileHelper() The default constructor.
static readonly DefaultAutoExpireTime By default, files older than 1 hour is cleared
const DefaultMaxFilesInDirectory By default, if more than 1000 files exists in directory, they are deleted
const DefaultTemporaryCheckFile A signature file that marks a folder as a temporary file to ensure that it actually contains temporary files and can be safely cleaned
static ClearTempFiles(…) Clears the temporary files.
static Delete(…) Deletes a file. (2 methods)
static PurgeDirectory(…) Clears a folder based on specified conditions
static PurgeDirectoryDefault(…) Clears a folder based on default conditions
static RandomFileCode() Gets a 13 character random code that can be used safely in a filename
static RegisterTempFile(…) Registers the temporary file.
static TryDelete(…) Tries to delete a file with given path.
static TryDeleteMarkedFiles(…) Tries to delete all files that is marked for deletion by TryDeleteOrMark in a folder.
static TryDeleteOrMark(…) Tries to delete a file or marks it for deletion by DeleteMarkedFiles method by creating a ".delete" file.

See Also