Thread: PLEASE help me with these linux programs how to make them

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    1

    Smile PLEASE help me with these linux programs how to make them

    Part 1
    The purpose of this part 1 is to give you practice in the use of following UNIX system calls other than using the
    command line arguments.
    • int read(int fd, char* buff, int len)
    • int write(int fd, char* buff, int len)
    • int open(const char* filename, int flags)
    • int close(fd)
    You need to write two programs.
    • The first program encipher.c will read one file name from the command prompt. It will open the file, read its
    contents, encrypt its contents using some encryption algorithm and write the encrypted contents in another file. If
    the file name is file1.txt then the new encrypted file name should be file1.cipher. The new encrypted file should
    be created in the present working directory.
    • The second program decipher.c will read one file name from the command prompt, which should be file1.cipher
    (a file already encrypted by the first program). It will open the file, read its contents, decrypt its contents using
    appropriate decryption algorithm and write the contents in another file. If the file name is file1.cipher then the
    new decrypted file name should be file1.txt. The new decrypted file should be created in the present working
    directory.
    Part 2
    The purpose of this part is to give you practice in the use of following UNIX system calls.
    • int fork( )
    • wait(&status)
    • exit(n)
    • int execlp(const char* progname, const char* arg0, const char* arg1, … const char* argn, ‘\0’)
    • int pipe(int pipefd[2])
    You need to write a program that will create/fork a child. The parent program should receive an integer array
    via command line arguments send that integer array to the child program using any of the IPC tools discussed in class
    (preferably pipe). The child program should sum up the contents of the array and will return the sum to the parent. The
    parent will finally display the sum in the file having file descriptor 1.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What have you tried, and what exactly do you need help with?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WIN32 API and Linux... *shudder
    By parad0x13 in forum C++ Programming
    Replies: 4
    Last Post: 07-24-2008, 07:27 PM
  2. Replies: 8
    Last Post: 03-10-2008, 12:08 PM
  3. Linux kernel not compiling
    By frenchfry164 in forum Tech Board
    Replies: 2
    Last Post: 04-29-2003, 04:10 PM
  4. Multiple OS's
    By drdroid in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 04-10-2003, 01:33 PM
  5. Linux for Windows!
    By Strut in forum Linux Programming
    Replies: 2
    Last Post: 12-25-2002, 11:36 AM