It's UWAweek 10 (1st semester, week 2)


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 selected article
Showing 1 of 1168 articles.
Currently 2 other people reading this forum.

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

Login to reply

5:42am Tue 3rd Oct, Christopher M.

> When we are invoking the mysync program how should we handle the case of a directory like the one below? > > /media/UNIWA 2xxxxxxx/myUSB
Spaces may occur in any names, directories or files.
> This would be classified as two separate arguments unless it is enclosed in quotations. Are we able to assume that these types of directories are to be called with quotations so as to ensure that they are seen as a single argument?
It's only the shell, not your C code that will consider a name with spaces as 2 arguments, so we need to use the syntax of the shell to keep the 'pieces' as one argument: '/media/UNIWA 2xxxxxxx/myUSB' or "/media/UNIWA 2xxxxxxx/myUSB" or "/media/UNIWA\ 2xxxxxxx/myUSB" So anyone calling your program will need to use on of the above techniques to provide a name with spaces. By the time your program receives the name, the 'extra characters' will not be present.

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