- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 4
- Posts with Downvotes
- 3
- Downvoting Members
- 2
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 … | |
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 … | |
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. | |
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); … | |
Re: > 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. … | |
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 … | |
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 … | |
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? | |
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 ---> … | |
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 … | |
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 … | |
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, … | |
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 … |