C# 클래스 GitSharp.Core.LockFile

Git style file locking and replacement. To modify a ref file Git tries to use an atomic update approach: we write the new data into a brand new file, then rename it in place over the old name. This way we can just delete the temporary file if anything goes wrong, and nothing has been damaged. To coordinate access from multiple processes at once Git tries to atomically create the new temporary file under a well-known name.
상속: IDisposable
파일 보기 프로젝트 열기: jagregory/GitSharp 1 사용 예제들

공개 메소드들

메소드 설명
Commit ( ) : bool
CopyCurrentContent ( ) : void

Copy the current file content into the temporary file. This method saves the current file content by inserting it into the temporary file, so that the caller can safely append rather than replace the primary file. This method does nothing if the current file does not exist, or exists but is empty.

Dispose ( ) : void
GetOutputStream ( ) : Stream

Obtain the direct output stream for this lock. The stream may only be accessed once, and only after Lock() has been successfully invoked and returned true. Callers must close the stream prior to calling Commit() to commit the change.

Lock ( ) : bool

* Try to establish the lock.

LockFile ( FileInfo file ) : System

Create a new lock for any file.

LockForAppend ( ) : bool

Try to establish the lock for appending.

Unlock ( ) : void
Write ( ObjectId id ) : void
Write ( byte content ) : void

비공개 메소드들

메소드 설명
RequireLock ( ) : void
SaveStatInformation ( ) : void

메소드 상세

Commit() 공개 메소드

public Commit ( ) : bool
리턴 bool

CopyCurrentContent() 공개 메소드

Copy the current file content into the temporary file. This method saves the current file content by inserting it into the temporary file, so that the caller can safely append rather than replace the primary file. This method does nothing if the current file does not exist, or exists but is empty.
/// The temporary file could not be written, or a read error /// occurred while reading from the current file. The lock is /// released before throwing the underlying IO exception to the /// caller. ///
public CopyCurrentContent ( ) : void
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

GetOutputStream() 공개 메소드

Obtain the direct output stream for this lock. The stream may only be accessed once, and only after Lock() has been successfully invoked and returned true. Callers must close the stream prior to calling Commit() to commit the change.
public GetOutputStream ( ) : Stream
리턴 Stream

Lock() 공개 메소드

* Try to establish the lock.
/// the temporary output file could not be created. The caller /// does not hold the lock. ///
public Lock ( ) : bool
리턴 bool

LockFile() 공개 메소드

Create a new lock for any file.
public LockFile ( FileInfo file ) : System
file System.IO.FileInfo the file that will be locked.
리턴 System

LockForAppend() 공개 메소드

Try to establish the lock for appending.
/// The temporary output file could not be created. The caller /// does not hold the lock. ///
public LockForAppend ( ) : bool
리턴 bool

Unlock() 공개 메소드

public Unlock ( ) : void
리턴 void

Write() 공개 메소드

public Write ( ObjectId id ) : void
id ObjectId
리턴 void

Write() 공개 메소드

public Write ( byte content ) : void
content byte
리턴 void