EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Directory Creation Problem

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#1385
Posted: 10/09/2006 08:00:42
by Imran Kazi (Basic support level)
Joined: 08/21/2006
Posts: 11

I am using SolFS .Nets managed version dll. I Open the storage with the code as below
Storage = new SolFS::SolFSStorage();

Storage->FileName = strStorage;
Storage->Logo = "";
Storage->PageSize = 512;
Storage->UseTransactions = false;
Storage->PathSeparator = '\\';
Storage->UseTransactions = true;
Storage->UseAccessTime = false;
Storage->ReadOnly = false;
Storage->Open(StorageOpenMode::somOpenExisting);


Now when i try to create Directory in this Storage i get the error message as below.
"Can not perform this opeartion on active storage"

The Statement for Creating the directory is as below
Storage->ForceCreateDirectories(strCachePath); //strCachePath= "dirname\"



What might be the reason.

Please help at the earliest.

Thanks
#1387
Posted: 10/09/2006 10:59:54
by Eugene Mayevski (EldoS Corp.)

Looking at the source code, I don't see a place, where this error can be returned. If we look at the code of ForceCreateDirectories, we see the following:

Code
      void ForceCreateDirectories(String *path)
      {
         CheckClosed();
         CheckActive();
         
         PWideChar dname = NULL;
         if (path)
            dname = (PWideChar)(void*)Marshal::StringToBSTR(path);
         try
         {
            CheckStorageResult(StorageForceCreateDirectories(m_Storage, dname));
         }
         __finally
         {
            Marshal::FreeBSTR(dname);
         }
      }


CheckActive() ensures, that the storage is *active*. If the storage is not active, then the error "Can not perform this opeartion on not active storage" happens.

BTW you need to pass the absolute name, i.e. not "dirname\", but "\dirname". Please try this.


Sincerely yours
Eugene Mayevski
#1390
Posted: 10/10/2006 05:53:39
by Imran Kazi (Basic support level)
Joined: 08/21/2006
Posts: 11

After doing the change in the absolute name i.e. from "dirname\" to "\dirname", Now i am getting the exception as "SolFS Error: Can not perform this opeartion on read only storage"

Will you please let me know how to remove the read attribute from the eldos storage (Please refer the code snippet above)
#1396
Posted: 10/10/2006 10:00:42
by Eugene Mayevski (EldoS Corp.)

I've tested the assembly and it appears to work correctly with both dirname\ and \dirname in both VS 2005 and VS 2003 (with VC.NET projects). So we need to understand, what's going on on your side. Does your problem happen only on particular storage or on any storage? Does the folder, which you are trying to create, already exist?


Sincerely yours
Eugene Mayevski
#1404
Posted: 10/11/2006 00:29:07
by Imran Kazi (Basic support level)
Joined: 08/21/2006
Posts: 11

I have checked at my end, The folder is not already created. What do you mean by "Does your problem happen only on particular storage or on any storage?". What clarifications you want from my end?
#1405
Posted: 10/11/2006 00:31:25
by Imran Kazi (Basic support level)
Joined: 08/21/2006
Posts: 11

Will you please send me a small code which will open the storage and will create directory in the storage. Please do the needful.

Thanks
#1407
Posted: 10/11/2006 01:15:51
by Eugene Mayevski (EldoS Corp.)

As I said, your code works here. So we need the exact example.

Quote
Imran Kazi wrote:
What do you mean by "Does your problem happen only on particular storage or on any storage?".


Exactly what I said. Any storage or this particular storage? Does the problem happen when you use other storages?


Sincerely yours
Eugene Mayevski
#1411
Posted: 10/11/2006 01:26:12
by Imran Kazi (Basic support level)
Joined: 08/21/2006
Posts: 11

The Problem is only with this particular SolfS storage, i am not using any other storages. I can create directory in my windows explorer. no problem at all. Please send me a small code that opens the solFS storage and create a directory in it.
#1412
Posted: 10/11/2006 01:34:46
by Eugene Mayevski (EldoS Corp.)

Please try to create other storage using SolFS Explorer and test your code with other storage. It's possible, that your storage got corrupted in some way. When you work with corrupted storages, sometimes unexpected errors happen. Use CheckAndRepair() method to check the state of the storage.

The code below works ok on our storage:

==
// This is the main project file for VC++ application project
// generated using an Application Wizard.

#include "stdafx.h"

#using <mscorlib.dll>

using namespace System;

int _tmain()
{
SolFS::SolFSStorage *Storage = new SolFS::SolFSStorage();

Storage->FileName = "C:\\Temp\\Test.st";
Storage->Logo = "";
Storage->PageSize = 512;
Storage->UseTransactions = false;
Storage->PathSeparator = '\\';
Storage->UseTransactions = true;
Storage->UseAccessTime = false;
Storage->ReadOnly = false;
Storage->Open(SolFS::StorageOpenMode::somOpenExisting);

Storage->ForceCreateDirectories("dirname\\"); //strCachePath= "dirname\"

return 0;
}
==


Sincerely yours
Eugene Mayevski
#1414
Posted: 10/11/2006 01:46:54
by Imran Kazi (Basic support level)
Joined: 08/21/2006
Posts: 11

Will there be any problem, if i open the storage which is already opened. because in my code it seems that i try to open the storage which is already opened.
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 12870 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!