Is RCS safe for binary files?

Is it safe to use RCS (diff) for binary files?

I did some experimenting, checking in and out different versions
of an executable, and it seemed to work just fine.

Before committing, though, I’d like to know if I will be setting
a time bomb that will later explode in my face.

TIA

Previously, Ken Schumm wrote in qdn.public.qnx4:

Is it safe to use RCS (diff) for binary files?

I did some experimenting, checking in and out different versions
of an executable, and it seemed to work just fine.

Before committing, though, I’d like to know if I will be setting
a time bomb that will later explode in my face.

You have to use a recent version of RCS, and you have to check in
binary files with the -kb option. This is likely to make a new copy
of the file in the repository at each check-in, rather than only
storing the diffs.

If you are checking in .wgt? files, remember that they must actually
be treated as binary files, even though they appear superficially to
be text.

If you fail to use the -kb option, then checking in a binary file
might work for one version and fail for another. The reason for this
is that RCS might do line terminator translation and keyword
expansion/contraction on checkout and checkin.

Cheers,
Andrew

Previously, Andrew Thomas wrote in qdn.public.qnx4:

Previously, Ken Schumm wrote in qdn.public.qnx4:
Is it safe to use RCS (diff) for binary files?

I did some experimenting, checking in and out different versions
of an executable, and it seemed to work just fine.

Before committing, though, I’d like to know if I will be setting
a time bomb that will later explode in my face.

You have to use a recent version of RCS, and you have to check in
binary files with the -kb option. This is likely to make a new copy
of the file in the repository at each check-in, rather than only
storing the diffs.

Thanks for the info.

I think I have the latest 4.25 stuff installed, but my ci doesn’t
support the -kb option. I also downloaded the latest rcs archive
from quics, but it’s ci doesn’t support -kb either.

Did you download and port a later version from somewhere?

[…]

I’ve been checking in/out binary executable files, and a lot of qnx windows
files without using any special options for a couple of years now, and have
not had any problems with them.
ms…

Andrew Thomas <Andrew@cogent.ca> wrote in message
news:Voyager.010411124746.12596D@andrewhome…

Previously, Ken Schumm wrote in qdn.public.qnx4:
Is it safe to use RCS (diff) for binary files?

I did some experimenting, checking in and out different versions
of an executable, and it seemed to work just fine.

Before committing, though, I’d like to know if I will be setting
a time bomb that will later explode in my face.

You have to use a recent version of RCS, and you have to check in
binary files with the -kb option. This is likely to make a new copy
of the file in the repository at each check-in, rather than only
storing the diffs.

If you are checking in .wgt? files, remember that they must actually
be treated as binary files, even though they appear superficially to
be text.

If you fail to use the -kb option, then checking in a binary file
might work for one version and fail for another. The reason for this
is that RCS might do line terminator translation and keyword
expansion/contraction on checkout and checkin.

Cheers,
Andrew

In CVS you have to add them as binary, then
the checkin takes care of the rest.

so, we do a :

cvs add -kb <filename

RCS should have something similar. Look at the add options.

Rob


Mike Schneider wrote:

I’ve been checking in/out binary executable files, and a lot of qnx windows
files without using any special options for a couple of years now, and have
not had any problems with them.
ms…

Andrew Thomas <> Andrew@cogent.ca> > wrote in message
news:Voyager.010411124746.12596D@andrewhome…
Previously, Ken Schumm wrote in qdn.public.qnx4:
Is it safe to use RCS (diff) for binary files?

I did some experimenting, checking in and out different versions
of an executable, and it seemed to work just fine.

Before committing, though, I’d like to know if I will be setting
a time bomb that will later explode in my face.

You have to use a recent version of RCS, and you have to check in
binary files with the -kb option. This is likely to make a new copy
of the file in the repository at each check-in, rather than only
storing the diffs.

If you are checking in .wgt? files, remember that they must actually
be treated as binary files, even though they appear superficially to
be text.

If you fail to use the -kb option, then checking in a binary file
might work for one version and fail for another. The reason for this
is that RCS might do line terminator translation and keyword
expansion/contraction on checkout and checkin.

Cheers,
Andrew

Previously, Ken Schumm wrote in qdn.public.qnx4:

I think I have the latest 4.25 stuff installed, but my ci doesn’t
support the -kb option. I also downloaded the latest rcs archive
from quics, but it’s ci doesn’t support -kb either.

Did you download and port a later version from somewhere?

We use CVS version 1.10, which uses RCS under the hood.

I’m not in fact sure whether CVS 1.10 uses ci and co, or whether the
equivalent functionality is now built directly into cvs. On my
QNX4 machine:

andrew@1:/home/andrew> ci -V
RCS version 5.7

andrew@1:/home/andrew> use ci
ci - check in RCS revisions (UNIX)

-k[rev] search for keywords values for revision, etc.

This documentation is nonsense. The man page says:

-ko Generate the old keyword string, present in the
working file just before it was checked in. For
example, for the Revision keyword, generate the
string $Revision: 1.1 $ instead of $Revision: 5.13
$ if that is how the string appeared when the file
was checked in. This can be useful for file for-
mats that cannot tolerate any changes to substrings
that happen to take the form of keyword strings.

-kb Generate a binary image of the old keyword string.
This acts like -ko, except it performs all working
file input and output in binary mode. This makes
little difference on Posix and Unix hosts, but on
DOS-like hosts one should use rcs -i -kb to ini-
tialize an RCS file intended to be used for binary
files. Also, on all hosts, rcsmerge(1) normally
refuses to merge files when -kb is in effect.

CVS respects these flags. I’ve never really delved any deeper than to
determine that -kb was necessary for binary files. Since it really
has to do with keyword substitution, you can get lucky with binary
files that happen not to contain the $keyword …$ pattern in them.
This is not normally a good risk.

Cheers,
Andrew

Previously, Andrew Thomas wrote in qdn.public.qnx4:

Previously, Ken Schumm wrote in qdn.public.qnx4:
I think I have the latest 4.25 stuff installed, but my ci doesn’t
support the -kb option. I also downloaded the latest rcs archive
from quics, but it’s ci doesn’t support -kb either.

Did you download and port a later version from somewhere?

We use CVS version 1.10, which uses RCS under the hood.

I’m not in fact sure whether CVS 1.10 uses ci and co, or whether the
equivalent functionality is now built directly into cvs. On my
QNX4 machine:

andrew@1:/home/andrew> ci -V
RCS version 5.7

Hmm.

$ci -V
RCS version 5.7

$ci -kb junk
RCS/junk,v ← junk
ci: junk: warning: can’t find a date
ci: junk: warning: can’t find an author
ci: junk: warning: can’t find a state
ci: RCS/junk,v: Symbolic name `b’ is undefined.

junk is just a simple “hellow world” type binary.

[…]

Rob Davidson wrote:

In CVS you have to add them as binary, then
the checkin takes care of the rest.

so, we do a :

cvs add -kb <filename

As far as I remember the “-kb” option belongs to the “rcs” command.

When a new RCS file is added, this is done with

rcs -i [-kb] newfile


After this you can check in the file with “ci” …

But I’d recommend using CVS, too. It’s easy to reserve certain
file patterns to be treated as binary files automatically, which
is really helpful, if you want to deal with PhAB structures :slight_smile:

The CVS documentation is very helpful, as well …


| / | __ ) | Karsten.Hoffmann@mbs-software.de MBS-GmbH
| |/| | _ _
\ Phone : +49-2151-7294-38 Karsten Hoffmann
| | | | |
) |__) | Fax : +49-2151-7294-50 Roemerstrasse 15
|| ||// Mobile: +49-172-3812373 D-47809 Krefeld

We tried using RCS to store binary files. It seemed to keep the latest
version okay (i.e., it was okay) but when we tried to extract an earlier
revision it didn’t extract the file properly (i.e., it was corrupted
slightly). As a result, I don’t recommend using RCS.