It's UWAweek 9 (1st semester, week 1)


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 5 other people reading this forum.

 UWA week 43 (2nd semester, study break) ↓
SVG not supported

Login to reply

4:28am Tue 24th Oct, Christopher M.

> how do we check if a file is executable without using execv() to actually execute it? The usage of S_IXUSR in stat() appears to primarily help us check the execute permission. Could you advise on how to determine if a file is executable?
I don't believe that you can, other than by repeating what execv() does from within your own code. As you've suggested, using the stat permissions only check if a permission bit is set - you could, for example, set execute permissions on an MS-Word document, but that wouldn't make it executable. Of note, the permission mode bits - read, write, and execute - are checked by certain system-calls (e.g. opening a file) but they provide a necessary condition, not a sufficient one.

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