Location of storage

Sep 8, 2011 at 3:37 PM

Is there any way I can change the location of the index file. Right now its in C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0

Your source code is very cryptic I failed to find exactly where you get the path.

Sep 10, 2011 at 8:47 AM

Hi,

if you use the FileStorageFacade (would be my advise...), you simple pass the filename as the first argument to all the functions. If you only supply the name of the filestorage, it will use the 'current' directory that is connected to the current thread, so apparently in your case that is C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0. If you want the Filestorage to use another location, simply insert the path in front of that argument, like so:

// without specifying folder will use the 'default' current folder...
var fileStorageName = @"foobar";
FileStorageFacade.Create(fileStorageName, CreateFileStorageBehaviour.ThrowExceptionWhenExists);

// explicitly specifying folder will use that location (the index and data files for the "foobar" storage will be create in the root of the C drive)
var fileStorageName = @"c:\foobar";
FileStorageFacade.Create(fileStorageName, CreateFileStorageBehaviour.ThrowExceptionWhenExists);

var fileStorageName = @"C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\foobar";
FileStorageFacade.Create(fileStorageName, CreateFileStorageBehaviour.ThrowExceptionWhenExists);

 

The sample applies for the methods you use to store and retrieve items from the filestorage.

GL!