GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 29-May-2006, 14:04
oracus oracus is offline
New Member
 
Join Date: May 2006
Posts: 1
oracus is on a distinguished road

Programming in Minix


Hello. I want make this but i dont know how. Please give me a hand of help :-)

"Create a new command for Minix, that will be called UNITE. UNITE command will make and show on screen,in a file the contests of two files, joining together. The syntax must be like this : unite filename1 filename2 filename3

Filename1 and filename2 will be the names of the two joining files, and filename3 the file that will be produced.
The command should work like this : File filename3 will contain data of the filename1+filename2 joining (with that order) and will show it on screen.

The file that you create must be in /usr/src/commands/simple catalog with the name UNITE.C. Also you must modify the corresponding makefile."



sorry for my english
  #2  
Old 29-May-2006, 14:24
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,791
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Programming in Minix


Quote:
Originally Posted by oracus
Hello. I want make this but i dont know how.


Program steps:

Code:
1. Get file names from command line. 2. Open file1 and file2 for reading and file 3 for writing (all in binary mode) If there is any error in attempting to open a file, report it to the user and exit the program. 3. Loop: read next char from file 1 if it's EOF, then exit the loop else write it to file 3 and continue the loop 4. Loop: read next char from file 2 if it's EOF, then exit the loop else write it to file 3 and continue the loop 5. Close file 3, file 2 and file 1 6. Bid the user a fond adieu.

The assignment seems to require echoing each char on the screen as they are copied to the target, so just use putchar() or some such thing in the loops where you are reading and writing the files.


If you don't know how to use a Makefile, then look for examples in your book or on-line.

Test the program in your development directory.

When the program has been thoroughly tested, install it in the required directory (using "make install" in your Makefile to copy it to the designated place).

If you have any questions on your code or your Makefile, then you can ask.

1. Show the code (and/or Makefile). This shouldn't be a huge amount of code, so post the entire program, not just a few lines that you think are problematic.

2. Tell us what you did (what command line or however else you invoked the program).

3. Tell us what happened.If you got compiler messages that you don't understand, then post the exact message (copy it directly into your post). If the program compiled OK but gave unexpected behavior, describe it.

4. Tell us what you expected to happen.

5. Tell us what you don't understand about the difference between 3 and 4.


Regards,

Dave
 
 

Recent GIDBlogWriting a book by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
printer / font color / windows programming nicolas_qc MS Visual C++ / MFC Forum 0 04-Jan-2006 00:13
Read/ Write EXCEL files using C/C++ programming confused_pig C++ Forum 4 25-Nov-2005 01:27
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 16:41
Network programming pointer C++ Forum 2 20-May-2005 15:36
GUI programming crystalattice C++ Forum 5 14-Sep-2004 13:17

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:34.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.