In article <11**********************@e9g2000prf.googlegroups. com>,
ks********@gmail.com <ks********@gmail.comwrote on Monday 12 Nov 2007
8:56 pm:
On Nov 12, 4:55 pm, Mark Bluemel <mark_blue...@pobox.comwrote:
>Udai Kiran wrote:
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...
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.