Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+4
Strength to Decrease Rep
-1
45% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
4
Posts with Downvotes
3
Downvoting Members
2
1 Commented Post
0 Endorsements
~4K People Reached
Favorite Forums
Favorite Tags
c x 58
Member Avatar for phil750

Hey all, I've been trying to build a simple c shell for assignment, and im a bit stuck. It doing something different on my laptop to that it does on my pc :S laptop is on mint 7 pc is virtual machine on mint 8. Im using the getcwd to …

Member Avatar for C++ThugLife
0
272
Member Avatar for phil750

I'm having trouble building in a pipe, i have program reads in from argv using fgets spilts up using strtok into command,cmd and cmd2. then i have a if statement [code] if(strcmp(cmd, "|")==0) [/code] then i open the file for writing [code] strcmp(filename, cmd2); file2=open(filename, O_WRONLY); [/code] now im confussed …

Member Avatar for phil750
0
107
Member Avatar for phil750

Say i just do a simple printf statement [code] printf("i want this text to be different color > %s", thisbit); [/code] i want whatever i print out at the %s (the string) to be different color. Im sure it only something little that why i ask.

Member Avatar for Adak
0
539
Member Avatar for phil750

Im mid way through writting my own c shell and having trouble with my redirecting, i use strtok to spilt the input into 2 parts, argv0 being command and argv1 being cmd i have this for redirecting so far [code] if(strcmp(cmd,">")==0) { strcpy(filename, command); filein = open(filename, O_RDONLY); dup2(filein,0); close(filein); …

Member Avatar for phil750
0
1K
Member Avatar for rgpii

I have an assignment that calls for me to only use standard C. I am currently trying to take in input from a file using fopen() and then take in lines from the file using fgets(). The original problem was that fgets() quits taking in input after six lines. "Something" …

Member Avatar for rgpii
0
186
Member Avatar for phil750

I have a program, my own shell where the first input is command and the 2nd is cmd. Im trying to get cd working but having trouble with chdir function, i have this and it just gives me a segmentation fault and i dont understand why. [code] while(!strcmp(command,"cd")) // while …

Member Avatar for phil750
0
529
Member Avatar for phil750

I have code that outputs data as so [code] Input file name: file.txt Input text: Process id 1, Quantum No 2, Priority 0 Process id 2, Quantum No 3, Priority 1 Process id 3, Quantum No 3, Priority 0 Process id 4, Quantum No 1, Priority 2 Start of processing …

0
75
Member Avatar for phil750

I have an array, b[10]; i would like to add up all the values in that array and store the answer as wt. any help?

Member Avatar for mrnutty
0
94
Member Avatar for phil750

I have an array full of ints, the program prints out a line depends on the numbr of int e.g. if int is 8 it will print the line 8 times. And do this for all the ints stored in the array. this is my output: Start of processing ---> …

0
75
Member Avatar for phil750

Ok i half have a working scheduler. The idea is to print out input from a text file, with the process id quantum and priority, sort them out into priority order, 0-20(0 highest) ad print them out the number of times the quatum is. here is what i have so …

Member Avatar for phil750
0
100
Member Avatar for phil750

Say i have an [code] int c =8; [/code] and i want to do a fork to say do a printf [code] printf("hello im number blah blah"); [/code] is there a way to do that printf as many times as whatever c is equal too? using a fork(). maybe something …

Member Avatar for gerard4143
0
77
Member Avatar for phil750

So i have to build a scheduler in priority ques, which will read infomation from test files. Also the work out the wait time and finish time. Text file will be like this; process1 21 3 process2 23 1 process3 45 20 [processID][space][Quantum][space][priority] So here what i have so far, …

Member Avatar for phil750
0
97
Member Avatar for phil750

I am currently writing a basic program scheduler (just started) which we have a text file with format of Process(id) (space) (quantum) (space) (priority). I am working on the first bit of the program actually reading in the text file and am trying to assigned the process ids, quantum and …

Member Avatar for phil750
0
113