md5sum c function

U

Udai Kiran

Hi all,
I have been looking for a c function that can calculate md5sum of
file given the path of the file. I know that the md5sum utility is
included in gnu coreutils. but how can I use this as a function. Is
there any library that can do this for me.
Thanks in advance.
udai.
http://s.udaykiran.googlepages.com/
 
M

Mark Bluemel

Udai said:
Hi all,
I have been looking for a c function that can calculate md5sum of
file given the path of the file. I know that the md5sum utility is
included in gnu coreutils. but how can I use this as a function. Is
there any library that can do this for me.
Thanks in advance.
udai.
http://s.udaykiran.googlepages.com/
Google and Wikipedia got me a solution in moments. Probably quicker than
posting to a newsgroup and waiting for a response...
 
K

ksashtekar

Google and Wikipedia got me a solution in moments. Probably quicker than
posting to a newsgroup and waiting for a response...

You can use the system() function prototyped in the stdlib.h. in the C
library. It can invoke any executable file/script in the file system.
You can also pass appropriate commands line parameters.
 
M

Mark Bluemel

You can use the system() function prototyped in the stdlib.h. in the C
library. It can invoke any executable file/script in the file system.
You can also pass appropriate commands line parameters.

And that helps the original poster precisely how?

I would assume he wishes to use the md5sum for a file within
his code. Running an external program doesn't move him forward
very far, as far as I can see.
 
S

santosh

You can use the system() function prototyped in the stdlib.h. in the C
library. It can invoke any executable file/script in the file system.
You can also pass appropriate commands line parameters.

Using system() makes your code inherently non-portable. In particular
consider that not all systems come with an md5sum utility
pre-installed, example Windows.

While it may sometimes be necessary in this particular case it pretty
easy to use any one of the several public implementations of an md5sum
function, after noting the license.
 

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

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top