EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Having big problems.

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
Posted: 05/01/2006 06:24:35
by Brett Graffin (Standard support level)
Joined: 04/28/2006
Posts: 3

Below is my actual code useage of Get-SetFileTag. I cannot get it to read back correctly after setting it. What am I doing wrong? If anybody can help, please...

sStr : string;

SolFS.GetFileTagInfo(FName, 34500, TagExists);
if(TagExists = TRUE) then
SolFS.GetFileTag(FName, 34500, @sStr[1], nTagSize);
RzMemo_1.Text := sStr;

sStr := Trim(RzMemo_1.Text);
SolFS.SetFileTag(FName, 34500, @sStr[1], Length(sStr));
Posted: 05/01/2006 06:43:17
by Eugene Mayevski (EldoS Corp.)

GetFileTagInfo returns the size of the tag data. You need to allocate buffer space before calling GetFileTag. I.e.

nTagSize := SolFS.GetFileTagInfo(FName, 34500, TagExists);
if(TagExists = TRUE) then
  SetLength(sStr, nTagSize);
  SolFS.GetFileTag(FName, 34500, @sStr[1], nTagSize);

Also, remember that tag size should not exceed PageSize-32 bytes.

Sincerely yours
Eugene Mayevski



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