LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2004, 01:48 PM   #1
jetley
LQ Newbie
 
Registered: May 2004
Distribution: rh9
Posts: 1

Rep: Reputation: 0
Arrow generating uuids with uuid_gen ( libuuid )


hi!
i've been trying to generate uuids with the libuuid api. i've tried the following code many times and read through the man pages as many times.
i'm still getting the incorrect output format.

here's the code
/****************************************/
#include <stdio.h>
#include <uuid/uuid.h>

int main(){
char string[37];
uuid_t gen;


uuid_generate(gen);
uuid_unparse(gen, string);
printf("\n%08x-%04x-%04x-%04x-%012x", string);
}

/***************************************/

*i get an output that resembles:

bffff5f0-0097-40015a38-66323632-000038666139

*when it should look like (this is what i got using uuidgen) :

2b1fcb57-141d-4e12-91eb-237a242c72dc

i.e. the format is all messed up in the middle

am i missing something here??
please help me out !!

thanks a million
jetley

Last edited by jetley; 05-19-2004 at 01:58 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating PDF files ?? concoran Programming 6 09-25-2005 12:26 AM
Generating A Script gizza23 Linux - Software 7 07-24-2005 08:33 PM
Generating hash in perl ? MikeFoo1 Programming 3 05-21-2005 07:03 PM
update libuuid error Virgola Debian 2 05-12-2005 08:47 AM
Generating a CSR shaggz Linux - General 1 01-31-2003 12:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration