EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SolFSStorage.SetFileAttributes method

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 07/24/2008 14:37:01
by tagnal (Standard support level)
Joined: 03/18/2008
Posts: 20

I am having a problem with setting file attributes using this function. After I have imported a file into the SolFSStorage object, I am trying to set the file attributes that it had in windows.

As an example, I just imported a Thumbs.db file which has the Hidden file attribute set and am now trying to set its file attributes within the storage.

if (hidden)
   MyVault.SetFileAttributes(fullStoragePath, 256);

fullStoragePath is the path of Thumbs.db in the storage object, "\\Thumbs.db"
265 is the int value specified in the documentation for attrHidden.

Doing this, I get an exception:
SolFS.ESolFSError: SolFS Error: Invalid parameter
at SolFS.?A0x3695e58c.CheckStorageResult(Int32 StorageResult)
at SolFS.SolFSStorage.SetFileAttributes(String fileName, Int32 attributes)
at Myproject.Myclass.Import_file(myParams)

Any help as to what I am doing wrong would be appreciated.

Posted: 07/25/2008 02:16:32
by Alexander Plas (EldoS Corp.)


Your operation not only set attrHidden but also clear all other attributes including attrFile. Please use following code to set or clear attributes

  LongWord Attr = MyVault.GetFileAttributes(fullStoragePath);
  if (hidden)
    Attr |= attrHidden;
    Attr &= ~attrHidden;
  MyVault.SetFileAttributes(fullStoragePath, Attr);
Posted: 07/25/2008 19:28:49
by tagnal (Standard support level)
Joined: 03/18/2008
Posts: 20

Thanks for the reply. I was able to get this working with your suggestion. =)



Topic viewed 2401 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!