Skip to content

An API that makes sure your program can only have one stream per file. It makes sure that all threads access the same stream.

License

Notifications You must be signed in to change notification settings

DaanV2/Concurrent-File-Stream-Manager.Net

Repository files navigation

Concurrent File Stream Manager

An API that makes sure your program can only have one stream per file. It makes sure that all threads access the same stream.

Usage

C++ / CLI

    String ^ Filepath = "C:\\Test\\SomeFile.txt";
    //Creates a new manager
    ConcurrentFileStreamManager ^ Manager = gcnew ConcurrentFileStreamManager();
    //Retrieve concurrent filestream
    FileStream ^ stream = Manager->Open(Filepath);

    //Lock stream
    stream->Lock();

    //Read/Write/Seek or do all kinds of stuff with a stream here

    //Unlock stream
    stream->Unlock();

    //closes the stream and flushes
    Manager->Close(stream);

C#

    String Filepath = @"C:\Test\SomeFile.txt";
    //Creates a new manager
    ConcurrentFileStreamManager Manager = new ConcurrentFileStreamManager();
    //Retrieve concurrent filestream
    FileStream stream = Manager.Open(Filepath);

    //Lock stream
    stream.Lock();

    //Unlock stream
    stream.Unlock();

    //closes the stream and flushes
    Manager.Close(stream);

About

An API that makes sure your program can only have one stream per file. It makes sure that all threads access the same stream.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages