PLEASE help me with these linux programs how to make them

This is a discussion on PLEASE help me with these linux programs how to make them within the Linux Programming forums, part of the Platform Specific Boards category; Part 1 The purpose of this part 1 is to give you practice in the use of following UNIX system ...

  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
    22,304
    What have you tried, and what exactly do you need help with?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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, 08:27 PM
  2. Replies: 8
    Last Post: 03-10-2008, 01:08 PM
  3. Linux kernel not compiling
    By frenchfry164 in forum Tech Board
    Replies: 2
    Last Post: 04-29-2003, 05:10 PM
  4. Multiple OS's
    By drdroid in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 04-10-2003, 02:33 PM
  5. Linux for Windows!
    By Strut in forum Linux Programming
    Replies: 2
    Last Post: 12-25-2002, 11:36 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21