It's printing (whenever I can get to print) random lines.
Type: Posts; User: kahad
It's printing (whenever I can get to print) random lines.
I'm trying to type a socket program that will allow me to transfer a file between a client and a server on two different computer, but it's not working. What's wrong with the code???
Server
...
Updating code to most recent version. I think the only porlbems I am having is that my alarm doesn't work and I can't seem to make it keep asking for a line after it prints out the first line.
...
Now it;s not typing back the text in capital letters. It was doing that.
Prompt.C
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <sys/wait.h>
That line is there to send the SIGTERM signal to the child to kill it. My logic is that if the code gets to that function, I have enter either Control - D, Control - C, or Control - /.
Updating post with current code to reflect changes made.
The thing I currently focusing on is the "If the user does not enter any line one minute after a prompt, the parent process should print a...
[QUOTE=Salem]> execl("Toupper", "Toupper", 0);
> kill(getppid(), SIGUSR2);
If the execl succeeds, then the kill will never happen.
I thought that was needed to send the SIGUSR2 signal to...
I'm having trouble with two programs that work with pipes, processes, and signals. The first program, prompt.c, takes the path of the executable of the second program, toupper.c, as its command-line...
Ok, I get the point. I'll indent more.
Now, where's that last ll fail CS306 coming from???
It only replaces the first occurance of pattern1 per line.
And what's wrong with the indenting??? Everything is lined up perfectly.
EDIT: Well, not everything. One } needed to be moved one...
Okay. It mostly works now. However, it's doing strange things if the outfile already exists. It's supposed to overwrite the original content. Here's an example of what its doing.
Input text
...
Using Red Hat Linux as OS and C as language.
How do you test if an argument passed is a directory???
Expected argument:
program name, filename, pattern 1, pattern 2
Thanks
Signed,
Ok, I got rid of that annoying segmentation fault. Now it's not writting anything.
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>...
I changed some of the code again. Same segmentation fault error.
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>...
I need to use System calls with the outfile.
Changed the program a little:
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include...
Hello, everybody. Need help with this program. It's meant to take a pattern 1 and replace the first occurance in a string with pattern 2. The patterns are case sensitive. I keep getting a...