C# 클래스 CodeCake.TemporaryFile

Small helper to automatically delete a temporary file. It is mainly a secure wrapper around GetTempFileName that creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file: the P:Path property exposes it. This file is flagged by default with FileAttributes.Temporary (short-lived): it will automatically be deleted by the Operating System during if it is still here on reboot. (Borrowed from CK.Core.)
상속: IDisposable
파일 보기 프로젝트 열기: SimpleGitVersion/CodeCake 1 사용 예제들

공개 메소드들

메소드 설명
Detach ( ) : void

Detaches the temporary file: it will no more be automatically destroyed. When created short-lived (see FileAttributes.Temporary), this flag is not reset: the file will be destroyed by the Operating System on the bext reboot.

Dispose ( ) : void

Attempts to delete the temporary file.

TemporaryFile ( ) : System

Initializes a new short lived TemporaryFile.

TemporaryFile ( bool shortLived ) : System

Initializes a new TemporaryFile. When shortLived is true, the FileAttributes.Temporary is set on the file.

TemporaryFile ( bool shortLived, string extension ) : System

Initializes a new TemporaryFile with an extension. When shortLived is true, the FileAttributes.Temporary is set on the file. The file will have a name looking like : xxxx.tmp.extension

When extension is ".", the final path will end with a ".".

TemporaryFile ( string extension ) : System

Initializes a new short lived TemporaryFile with an extension - the file will have a name looking like : xxxx.tmp.extension

비공개 메소드들

메소드 설명
DeleteFile ( ) : bool

메소드 상세

Detach() 공개 메소드

Detaches the temporary file: it will no more be automatically destroyed. When created short-lived (see FileAttributes.Temporary), this flag is not reset: the file will be destroyed by the Operating System on the bext reboot.
public Detach ( ) : void
리턴 void

Dispose() 공개 메소드

Attempts to delete the temporary file.
public Dispose ( ) : void
리턴 void

TemporaryFile() 공개 메소드

Initializes a new short lived TemporaryFile.
public TemporaryFile ( ) : System
리턴 System

TemporaryFile() 공개 메소드

Initializes a new TemporaryFile. When shortLived is true, the FileAttributes.Temporary is set on the file.
public TemporaryFile ( bool shortLived ) : System
shortLived bool True to set the on the file.
리턴 System

TemporaryFile() 공개 메소드

Initializes a new TemporaryFile with an extension. When shortLived is true, the FileAttributes.Temporary is set on the file. The file will have a name looking like : xxxx.tmp.extension
When extension is ".", the final path will end with a ".".
public TemporaryFile ( bool shortLived, string extension ) : System
shortLived bool True to set the on the file.
extension string Optional extension of the file (example : '.png' and 'png' would both work).
리턴 System

TemporaryFile() 공개 메소드

Initializes a new short lived TemporaryFile with an extension - the file will have a name looking like : xxxx.tmp.extension
public TemporaryFile ( string extension ) : System
extension string The extension of the file (example : '.png' and 'png' would both work)
리턴 System