It's UWAweek 42 (2nd semester, week 12)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 5 articles in this topic
Showing 5 of 738 articles.
Currently 147 other people reading this forum.


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported

Login to reply

👍?
helpful
1:46pm Mon 14th Oct, Harrison L.

Hello!

I was just wondering whether the input file will always be called in.txt, and the outfile will always be called out.txt since the project description says that we should take in.txt and out.txt as command-line arguments.

If a filename other than in.txt or out.txt is passed in should these be used instead? And if so, should I check that the extension is always .txt ?

Thank you!


SVG not supported

Login to reply

👍?
helpful
3:11pm Mon 14th Oct, ANONYMOUS

"Harrison Lisle" [email protected] wrote:

Hello!

I was just wondering whether the input file will always be called in.txt, and the outfile will always be called out.txt since the project description says that we should take in.txt and out.txt as command-line arguments.

If a filename other than in.txt or out.txt is passed in should these be used instead? And if so, should I check that the extension is always .txt ?

Thank you!

You can write is as an assumption that it will always be named that. This is a simple project so I doubt they'd check it. But a good practice is to not hard code it but instead let it work with any names. Hope this helps!


SVG not supported

Login to reply

👍?
helpful
9:27pm Mon 14th Oct, Joshua N.

"Harrison Lisle" [email protected] wrote:

Hello!

I was just wondering whether the input file will always be called in.txt, and the outfile will always be called out.txt since the project description says that we should take in.txt and out.txt as command-line arguments.

Yes. The spec explicitly states the names of the files will be in.txt and out.txt

If a filename other than in.txt or out.txt is passed in should these be used instead? And if so, should I check that the extension is always .txt ?

As Anon said it is good practice to be able to read a file of any name as opposed to a hard coded value. However, for this project you can assume that the file name passed in as a command line argument is always correct. So, no checking is necessary.

Thank you!


SVG not supported

Login to reply

👍?
helpful
4:01pm Wed 16th Oct, Harrison L.

I actually have already implemented it so as that the command-line arguments will be the files taken from/written to- is this okay? I assume that it is, as in.txt and out.txt are always passed when calling ./simulation


SVG not supported

Login to reply

👍?
helpful
7:54pm Wed 16th Oct, Joshua N.

"Harrison Lisle" [email protected] wrote:

I actually have already implemented it so as that the command-line arguments will be the files taken from/written to- is this okay? I assume that it is, as in.txt and out.txt are always passed when calling ./simulation

Yes. The first argument will always be in.txt (file read from) and the second will be out.txt (file written to).

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy