sdiff

R

Ravi Uday

hi,

Can anyone help me with a source code implementing UNIX 'sdiff'
utility in C.
Any clues leading to the solution is also welcome.

Basically the function should return me the difference between two
files viz., modified, added, deleted.

Thanks
- Ravi
 
C

CBFalconer

Ravi said:
Can anyone help me with a source code implementing UNIX 'sdiff'
utility in C. Any clues leading to the solution is also welcome.

Basically the function should return me the difference between
two files viz., modified, added, deleted.

One radical solution might be to get and read the source. I
believe it is a component of "textutils" or of "diffutils".
 
A

Ashish

Ravi Uday said:
hi,

Can anyone help me with a source code implementing UNIX 'sdiff'
utility in C.
Any clues leading to the solution is also welcome.

Basically the function should return me the difference between two
files viz., modified, added, deleted.

sdiff (whatever that means) is off-topic here.

Try a unix newsgroup.
 
R

Ravi Uday

[ snip ]
First start with a simple program that reads a text line from
one source file and compares it to a text line read from
another source file. If the two text lines are different,
output both with a separating line after them.

Next, comes the harder part: synchronizing. Figure out
how you can determine if one line exists that isn't in the
second file.

See also:
fopen, fclose, fgets.
strcmp, strncmp, fprintf, fputs.
feof.

How can i do it on Windows machine. Basically i need to just get the
number of lines - added, deleted and modified upon comparison of two
files.
sdiff actually has so many other features (ex. options ) which is not
needed to me. Also i checked the source code of sdiff - its not
portable to windows at all, and uses some kinds of IPC (signals )and
things like that which is not at all necessary to me. Is there some
kind of procedure/steps/algorithm that needs to be followed ??
All help is appreciated.
- Ravi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top