Skip to content

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 this duration are cleared.
const DefaultMaxFilesInDirectory By default, if more than this many files exist in a directory, they are deleted.
const DefaultTemporaryCheckFile A signature file that marks a folder as a temporary folder, ensuring that it actually contains temporary files and can be safely cleaned.
static Delete(…) Deletes the file at the given path. (2 methods)
static PurgeDirectory(…) Clears a folder based on the specified conditions.
static PurgeDirectoryDefault(…) Clears a folder based on the default conditions.
static RandomFileCode() Gets a 13 character random code that can be used safely in a file name.
static TryDelete(…) Tries to delete the file at the given path, ignoring any errors.
static TryDeleteMarkedFiles(…) Tries to delete all files in a folder that were marked for deletion by TryDeleteOrMark.
static TryDeleteOrMark(…) Tries to delete a file, or marks it for deletion by TryDeleteMarkedFiles by creating a ".delete" file.

See Also