Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-Apr-2008, 19:41
MikeP
Guest
 
Posts: n/a
Default

I'm having trouble finding out how to access commands in the console from a c++ program. Specifically, i want to use dd to overwrite a file by using /dev/urandom.
  #2 (permalink)  
Old 15-Apr-2008, 19:53
ken_yap
Guest
 
Posts: n/a
Default

Use the library call "system", as in:

status = system("cp foo bar");

Be careful with special characters to the shell, e.g. quotes, >, <, &, etc, as the command is interpreted by a shell.
  #3 (permalink)  
Old 16-Apr-2008, 21:34
MikeP
Guest
 
Posts: n/a
Default

Hey thanks a lot. That worked perfectly
 

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2