It's UWAweek 25 (mid-year break)

helpOSTS

This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting.

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.

How do I ask a good question?
Displaying the 2 articles in this topic
Showing 2 of 439 articles.
Currently 17 other people reading this forum.


 UWA week 16 (1st semester, week 7) ↓
SVG not supported

Login to reply

👍?
helpful
5:43pm Sat 20th Apr, ANONYMOUS

Hello professor, I've doubt about searching file into the system. as you mention in the assignment that, user will pass "tobacco_nation <csv data file> < year | country code > < Male | Female >" so, can i assume that whenever user pass the file name, user always provide the full path where file is located. for example : 1. tobacco_nation "WHO_tobacco_control_tonly.csv" 2000 Male or 2. tobacco_nation "~/stud/perm/WHO_tobacco_control_tonly.csv" 2000 Male Currently i'm assuming 1st scenario. that's why i used find command to search file in whole system.


SVG not supported

Login to reply

👍x1
helpful
8:51pm Sat 20th Apr, Michael W.

ANONYMOUS wrote:
> Hello professor, > I've doubt about searching file into the system. as you mention in the assignment that, user will pass "tobacco_nation <csv data file> < year | country code > < Male | Female >" so, can i assume that whenever user pass the file name, user always provide the full path where file is located. > > for example : > 1. tobacco_nation "WHO_tobacco_control_tonly.csv" 2000 Male > or > 2. tobacco_nation "~/stud/perm/WHO_tobacco_control_tonly.csv" 2000 Male > > Currently i'm assuming 1st scenario. that's why i used find command to search file in whole system.
Hi, The first argument is the full pathname to the file, which the testing program will supply. All your program has to do is open the file associated with $1; if it's not there, the program should simply stop and print an error message (which is the fifth example). While I now appreciate where you are coming from, finding a random file somewhere in the file-space with the same name may not be helpful. Better to keep things simple. After all, if the user gives you the path to a file which does not exist, it's their problem. Cheers MichaelW 👨‍🎨

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  5:07AM Sep 06 2023
Privacy policy