DBF files -- the last byte

306 views
Skip to first unread message

lizzyho...@gmail.com

unread,
Aug 23, 2023, 5:43:20 AM8/23/23
to Harbour Users
Most of my DBF files end with a 0x1A character (Harbour, FoxPro, dBaseIII)
Does anyone know why or what purpose it serves?
I'm writing some interface code in C, and I was wondering if this byte is important!

L.

pete....@gmail.com

unread,
Aug 23, 2023, 7:28:29 AM8/23/23
to Harbour Users
On Wednesday, 23 August 2023 at 12:43:20 UTC+3 lizzyho...@gmail.com wrote:
Most of my DBF files end with a 0x1A character (Harbour, FoxPro, dBaseIII)
Does anyone know why or what purpose it serves?

It's the end-of-file-marker of a harbour compatible .dbf
(hence, quite important)

regards,
Pete

lizzyho...@gmail.com

unread,
Aug 23, 2023, 8:53:09 AM8/23/23
to Harbour Users
Yup.....thanks.......
But the reason for my question is that a DBF header contains both record count and record length,
so the programmer can calculate the EOF position without needing a marker.

pete....@gmail.com

unread,
Aug 24, 2023, 7:58:47 AM8/24/23
to Harbour Users
"Programming economy" is probably the reason the original `.dbf` file designers have chosen to use an EOF marker.
Using just one byte as EOF marker is quite more "cheap" than repeated calculations every now and then.
Also, calculations are time consuming (and power hungry) and more prone to errors compared to locating a simple character.
By the way, I think that one of the main reasons the markers have been invented, thousands year ago and do still exist, was/is exactly that: to avoid the repeated calculations.

regards,
Pete

Auge & Ohr

unread,
Aug 24, 2023, 9:51:20 PM8/24/23
to Harbour Users
hi,

DBF was create when we have DOS and all Type of File "end" with Ctrl-Z = CHR(26) = 0x1A

Jim

pete....@gmail.com

unread,
Aug 25, 2023, 4:01:58 PM8/25/23
to Harbour Users
Hi Jim,
On Friday, 25 August 2023 at 04:51:20 UTC+3 Auge & Ohr wrote:
DBF was create when we have DOS and all Type of File "end" with Ctrl-Z = CHR(26) = 0x1A
 
You're right! 0x1A is the ASCII character used as EOF marker not only in old good DOS but also in
current versions of Windows.  I just tried to focus my thought particularly on the subject 
of "calculation vs marker" and why the later is more suitable for the purpose in question.

regards,
Pete

Ross McKenzie

unread,
Sep 1, 2023, 12:33:42 PM9/1/23
to Harbour Users
I have been away from "this world" for dozens of years. Thanks for giving me a much needed finger hold/

Cheers,
Ross (Melbourne Australia)

Klas Engwall

unread,
Sep 1, 2023, 12:50:22 PM9/1/23
to harbou...@googlegroups.com
Hi Ross,

> I have been away from "this world" for dozens of years. Thanks for
> giving me a much needed finger hold/
>
> Cheers,
> Ross (Melbourne Australia)

Welcome back to "this world"! Good to see you around. Are you still in
"that other world" - the microcontrollers?

Regards,
Klas

Ross McKenzie

unread,
Sep 2, 2023, 11:14:08 AM9/2/23
to Harbour Users
What a memory you have! Slowly getting used to being retired Klas. I am now 74. Only do work when someone twists my arm with an interesting (to me) project.

How are you?

Cheers,
Ross (Melbourne Australia)

Klas Engwall

unread,
Sep 2, 2023, 1:52:30 PM9/2/23
to harbou...@googlegroups.com
Hi Ross,

I am moving this thread to email.

Regards,
Klas
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: https://groups.google.com/group/harbour-users
> <https://groups.google.com/group/harbour-users>
> ---
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to harbour-user...@googlegroups.com
> <mailto:harbour-user...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/harbour-users/879f8456-e5c9-4fb0-9ac4-b5fddc8f74cfn%40googlegroups.com <https://groups.google.com/d/msgid/harbour-users/879f8456-e5c9-4fb0-9ac4-b5fddc8f74cfn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ross McKenzie

unread,
Sep 3, 2023, 9:07:55 AM9/3/23
to Harbour Users
Don;t use any gmail address. I don't use them. use the optusnet.com.au one. If you remember it.
Reply all
Reply to author
Forward
0 new messages