It's UWAweek 49

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 4 articles in this topic
Showing 4 of 1168 articles.
Currently 6 other people reading this forum.


 UWA week 39 (2nd semester, week 9) ↓
SVG not supported

Login to reply

👍?
helpful
12:42pm Fri 29th Sep, ANONYMOUS

Hi Chris, In the getting started section of the second project sheet, mkdir is listed as a system call that we may use. In the project requirements and fine print section of the project sheet point 8 reads: Your project must not invoke the standard utility programs cp or mkdir, or call the library function system(). Are we or are we not to use the mkdir system call? Thank you


SVG not supported

Login to reply

👍x1
helpful
12:47pm Fri 29th Sep, Christopher M.

ANONYMOUS wrote:
> Are we or are we not to use the mkdir system call?
There is a program (utility program) named mkdir, which you may not use. But there's also a system-call named mkdir() which you may use. The exact same is true for chmod and getopt .


SVG not supported

Login to reply

👍?
helpful
9:50pm Fri 29th Sep, Lewei X.

Thanks for pointing this out, I was just about to ask about this. As mkdir is a utility program that is called in the command line, how is it possible to use it in the C program? Could you highlight an exmaple of each in case I end up doing something stupid in my program?


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
12:47pm Mon 2nd Oct, Christopher M.

"Lewei Xu" <23*0*0*8@s*u*e*t*u*a*e*u*a*> wrote:
> Thanks for pointing this out, I was just about to ask about this. As mkdir is a utility program that is called in the command line, how is it possible to use it in the C program? Could you highlight an exmaple of each in case I end up doing something stupid in my program?
We can trivially call a command-line utility from within a C program by using for() and execl(). But the mkdir program does little more than call the mkdir() system-call, which we can do from within our own program. If the action performed by an external program was far more significant, such as sort or zip, then it'd make far more sense to spawn the external program.

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