We made a video explaining some of the background information about Unix and the terminal that may be helpful for this assignment. Here's an example to reinforce the discussion from the video: You may optionally specify a third argument which is the size of the buffer to pass when tokenizing.
If you do not include this command line argument, the buffer is sized to always have enough space to store the entire token. It is also integrated with sanitycheck for your convenience.
When interacting with the filesystem programmatically in C, you will use a C string to represent a path and can construct and dissect paths by string manipulation and library functions.
Working with paths is thus practice with C strings!
Whereas the standard C library functions provide only simple file reading/writing, the POSIX functions add more comprehensive services, including access to filesystem metadata (e.g.
modification time, who can access files), directory contents, and filesystem operations that are necessary for implementing Unix commands like in more detail later in the spec.Assignment by Julie Zelenski, with modifications by Nick Troccoli This assignment delves into those topics covered in recent string lectures and the second lab. This is an especially appropriate way to be introduced to C and Unix; not only does it continue a thread you began in assign0, but implementing the Unix operating system and its command-line tools were what motivated the creation of the C language in the first place!Implementing these programs is a very natural use of C, and you'll see how comfortably it fits in this role.Strings are important even if you are just dealing with numeric values since they are required to input and output the values to a file, so you will need to understand them in order to work in C.You can rely on Programming Homework Helper to provide any C programming homework help you may have.C strings also 8 bit characters so they can only encode ascii, although utf-8 is designed so that unicode strings can be used without encountering any 0 byte value which would end the string.The header file “string.h” should be included it you want to use the library string functions, and you are responsible for allocating and freeing memory used for strings, so you will also need “stdlib.h” for the malloc and free functions.The assignments are for you to solidify your own understanding and develop your individual skills.If you are having trouble completing the assignment on your own, please reach out to the course staff; we are here to help!you think is causing the issue; then, further investigate just that area to try and find the bug.As another example, if your program is crashing, take a similar approach, but use GDB and the command (or Valgrind) to narrow in on the source of the crash.