View Single Post
  #6   (View Single Post)  
Old 10th August 2008
Libran Libran is offline
New User
 
Join Date: Aug 2008
Posts: 5
Default

Quote:
Originally Posted by Carpetsmoker View Post
This should be possible, can you post:
  • The source of the C program
  • The command you used to compile this program
  • The command you used to run this program
Code for some help files I want to write:

#include <stdio.h>

main()
{
system("clear");
printf("CD burning procedure\n\n");
printf("Before burning, test with the -t option\n\n");
printf("To burn CD: burncd -f /dev/acd0 -v -s 8 data <fname> fixrate\n\n");
printf("To erase CD : burncd -f /dev/acd0 blank\n\n");
printf("Files in /home/Ron:\n\n");
system("ls");
}

Compiled with:
cc <filename>

Result is a.out - cannot execute this unless i move it to /usr/local/bin. Then can run from command line, but not from JWM menu. If I try to execute it drom that directory, it prints out all files in dir. I renamed it to Junk and then can run from command line, but not from /usr/local/bin

Edit - after reading what I wrote it becomes clear that the JWM menu is executing a.out because the last line of my code is being executed - system("ls"); The files then overwrie what the program has put to screen. Also, it seems apparent that renaming the a.out file to Junk doesn't work.

Last edited by Libran; 10th August 2008 at 04:07 PM. Reason: addition
Reply With Quote