CSharpTest.Net
FragmentedFile Constructor(String,Int32,Int32,Int32,FileOptions)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > FragmentedFile Class > FragmentedFile Constructor : FragmentedFile Constructor(String,Int32,Int32,Int32,FileOptions)

filename
The file name that will store the data
blockSize
The block size that was specified when CreateNew() was called
growthRate
The number of blocks to grow the file by when needed, or zero for on-demand
cacheLimit
The number of threads that can simultaneously access the file
options
The file options to use when opening the file

Glossary Item Box

Opens an existing fragmented file store, to create a new one call the CreateNew() static

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal filename As String, _
   ByVal blockSize As Integer, _
   ByVal growthRate As Integer, _
   ByVal cacheLimit As Integer, _
   ByVal options As FileOptions _
)
C# 
public FragmentedFile( 
   string filename,
   int blockSize,
   int growthRate,
   int cacheLimit,
   FileOptions options
)

Parameters

filename
The file name that will store the data
blockSize
The block size that was specified when CreateNew() was called
growthRate
The number of blocks to grow the file by when needed, or zero for on-demand
cacheLimit
The number of threads that can simultaneously access the file
options
The file options to use when opening the file

Example

Library/Library.Test/TestFragmentedFile.cs

C#Copy Code
using (TempFile file = new TempFile())
{
    using (FragmentedFile ff = FragmentedFile.CreateNew(file.TempPath, 512, 100, 2, FragmentedFile.OptionsDefault))
        TestCrud(ff, 256, 256);
    using (FragmentedFile ff = new FragmentedFile(file.TempPath, 512, 100, 2, FragmentedFile.OptionsDefault))
        TestCrud(ff, 256, 256);
}
VB.NETCopy Code
Using file As New TempFile()
    Using ff As FragmentedFile = FragmentedFile.CreateNew(file.TempPath, 512, 100, 2, FragmentedFile.OptionsDefault)
        TestCrud(ff, 256, 256)
    End Using
    Using ff As New FragmentedFile(file.TempPath, 512, 100, 2, FragmentedFile.OptionsDefault)
        TestCrud(ff, 256, 256)
    End Using
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys