473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

md5sum c function

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/

Nov 12 '07 #1
4 5130
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...
Nov 12 '07 #2
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.

Nov 12 '07 #3
ks********@gmail.com wrote:
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.
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.
Nov 12 '07 #4
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.
Nov 12 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ben Rf | last post by:
Hi I'm new to programming and i'd like to write a program that will parse a list produced by md5summer and give me a report in a text file on which md5 sums appear more than once and where they...
5
by: jwb | last post by:
Hello all, I just was wondering if any one knows how to compare compiled VB.NET executables to determine whether or not they are identical. In the dark ages (read: pre-CLR and .NET) one could...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
5
by: phil_gg04 | last post by:
Dear Javascript Experts, Opera seems to have different ideas about the visibility of Javascript functions than other browsers. For example, if I have this code: if (1==2) { function...
1
by: Andrew Chalk | last post by:
I am using VC++ v7.1. Each time that I do a build the md5sum of the resultant DLL is different. Is VC++ embedding a compile-time timestamp in the output file, or what? Many thanks
0
by: Rory Campbell-Lange | last post by:
I'd like to use an md5 function to hash some strings on debian stable/testing (7.3.2). Is it possible to do this? If so, how do I achieve it? Thanks for any help. Rory -- Rory Campbell-Lange...
2
by: chis2k | last post by:
I am trying to figure out how to get the MD5 sum of a file that is like the result from the MD5sum.exe program that is readily available on the internet. I tried the following but it gives me...
3
by: Gary Townsend | last post by:
Hey all i am looking to see if anyone has created a function or knows how to create an md5sum that would match the md5sum routines found commonly in C++ and Linux. Gary Townsend
1
by: Theadmin77 | last post by:
I know this is a stupid question but ....im stuck ... I have 2 files were i have to perform a md5sum check , the results (hash string) output to a file were must be stamped with the date and time...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.