Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SearchRec Fill

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,311
US
In the Turbo Pascal SearchRec, there's a field defined according to my references as "fill".

For reference:
Code:
 searchrec = record
   fill: array[1..21] of byte;
   attr: byte; 
   time: longint;
   size: longint;
   name: string[12];

I'm trying to find some reference which indicates what is stored there. Can anyone help out?
 
Hi

Well, I found an explanation once, long time ago. As far as I remember it is internal data used to ensure that all file data will be returned and only once, even if there are modifications on the filesystem in meantime. So do not touch it.

The content of the [tt]fill[/tt] field depends on the implementation. Not all Pascal compilers use it actually.

Feherke.
 
That's basically what I keep finding when I do find something mentioning it.

But basically, for what I'm doing (a findfirst/findnext that works in Delphi, but compatible with Turbo/Borland Pascal DOS programs), I need to know what it does so I wouldn't break any TP/BP programs that might use it for something, especially considering that I need to store 4 bytes within the record for the same purpose under Windows.

Right now, I'm just defining the SearchRec record to be equivalent to the Windows one, but I know that's going to have the potential to break some more, so hopefully I can figure out how to make use of the original record.
 
Alright, I think I found something. "SearchRec" is actually a DOS file structure called the "disk transfer area" - it gets used in FindFirst/FindNext, which is Int21, function 1A.

For the fields I saw in the definition I found (which was wrong, but it helped me interpret what I was seeing), it doesn't look like stomping on them with my four bytes of data is going to hurt much. Even the assembler programmers define the structure in the same way as Pascal "SearchRec", so I would think it would be exceedingly rare to find a program that would actually use that area for anything. So I should be fine.

In case you're curious, though. Not sure it's entirely right, but it was a start.:
Code:
 srec_fill = record
   s_attribute: byte; { attribute of search   }
   s_name: array[1..11] of char;  { search name used}
   extrabyte: byte;
   s_direntry: word; { directory entry number}
   s_clustnum1: word; { starting cluster number of current directory }
   s_reserved: word; { reserved }
   s_clustnum2: word; { starting cluster number of current directory }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top