EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How to associate impersistent metadata to a file?

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#5074
Posted: 02/19/2008 23:32:21
by Huihong Luo (Standard support level)
Joined: 02/10/2008
Posts: 10

Is there anyway to associate some memory metadata to a file that is available to mutiple file handles (that are pointing to the same file)? I know the StorageSetFileTag API, but that will persist the tag to the file, and it does NOT work for readonly storage.

I just needed to add some in-memory data to a file, and don't want it to be saved.

I have the src code, what is the data struct that can be modified to incorporate this?

Thanks,
#5076
Posted: 02/20/2008 01:01:26
by Eugene Mayevski (EldoS Corp.)

At the moment there's no such way. We will consider adding this functionality to SolFS 4. What amount of data do you want to associate with each file? Is it 4 bytes, 512 bytes, several kb, MBs?


Sincerely yours
Eugene Mayevski
#5078
Posted: 02/20/2008 01:23:11
by Eugene Mayevski (EldoS Corp.)

Actually you can do the following:

create an associative array that will have the fully qualified file names as hash keys and your data as values. Store your data there. If you delete the files from the storage, also remove the entries in this associative array. This is easy to implement and fast to obtain. There's no easy method to add such thing to SolFS and we don't want to overburden SolFS Engine with features of limited popularity.


Sincerely yours
Eugene Mayevski
#5079
Posted: 02/20/2008 01:26:51
by Huihong Luo (Standard support level)
Joined: 02/10/2008
Posts: 10

It's small amount of data. Basically, if you can allow to set a user data to the very deep file object, that will do. You can expose a couple of pointers to use.

I need to use this to record memory sections mapped by the file. It might be done from different file handles, so need to use the internal object to keep the list. Otherwise, I will have to implement a list/hashtable, which is a duplicate effort.

I browsed the src code, it seems that TStorageObject is the struct that can be used to support this? Is it true? Can I add an extra pointer field to keep the custom memory data?

Thanks,

Huihong
#5081
Posted: 02/20/2008 01:37:11
by Eugene Mayevski (EldoS Corp.)

Moved to HelpDesk.


Sincerely yours
Eugene Mayevski
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

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