Skip to main content
Engineering LibreTexts

20: System Services

  • Page ID
    54229
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    The term system services generally refers to asking the operating system for information.

    The read, write, and file operations (open, read, write, close) are common system services and have already been addressed in a previous chapter.

    Other system services include obtaining the date and/or time from the operating system and obtaining the command line arguments (if any). The term command line arguments is used to refer to information entered on the command line after the program name. This allows the user to provide some information to the program before it starts (or as the program is started), which might save time as compared to prompting for and interactively reading the information at run-time.

    While there are many system services, only these basic ones are presented for reference. These system services may be useful when working on more complex problems. Additionally, the calls and usage for other system services is very similar to how these are performed.

    • 20.1: Date and Time
      The date and time functions are combined into a single system service call.
    • 20.2: Command Line Arguments
      The usage of command line arguments, information entered on the command line after the program name, can be very useful in specific circumstances. By allowing the user to provide some information on the command line, it saves the effort of entering the information interactively after the program starts.
    • 20.3: Exercises


    This page titled 20: System Services is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Ed Jorgensen via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?