User Tools

Site Tools


blog:spring2016:pgrant3:journal

This is an old revision of the document!


Systems Programming Journal

JAN 25, 2016

The start of this course is showing us why C is such a powerful language, with regards to the problems we are attempting to solve. At this point, it seems that both languages can be used for our requirements. Although I am sure we will get closer to the machine, and we will see why C is such a versatile language.

So far, we are recreating the cat command on the unix command line. The logic behind doing so is similar to logic we have previously had to employ throughout our CS experience. But for me, instead of just including stdio.h like I usually do, we included other header files, that stdio.h includes and uses, giving us specific functionality instead of blanket including everything. Understanding what tools are required specifically for any problem, and being able to identify them, is a skill I soon hope to excel at.

FEB 1, 2016

After making a simple version of the cat command in C, we were challenged to come up with an addition to it that allowed the user to view line numbers given the argument. Through this simple version, we introduced command line arguments to our command. However, I could not seem to get the line numbers to show up properly. I could get the loop to spit out every line number, starting with the second line. It would display that line with the number properly, all the way through the last line.. plus two more lines for some reason. I could not get the first line number to effectively match with the first line of the “cat'd” file. I will have to look into that a bit more.

Next, we started our own implementation of the who command. So far, we have gotten it to print out the current user info, one at a time. It cycles through current user information when the desired key is pressed. I am interested to see where we can take this program. I am also interested in getting our first project so that I can take what we are learning and apply it more.

FEB 8, 2016

This week we completed implementing the who command in class. Our version is almost identical to the shells version of this command now. I am learning a lot about reading manual pages and the useful information they provide to us. As of now it is a little daunting, but I am sure that I will grasp it relatively soon.

We also implemented the list command, after finishing the who command. We got it to work properly in class, but I must have missed something as mine gets a seg fault when I attempt to run it. I will just have to comb through it more in order to figure out what is causing this issue.

Our first project was also assigned this week. We have to apply the change mode command in C. Luckily for us there is a function in the manual page that does this, given the correct parameters. So far, I can get mine to work properly so long as I tell it what modifications to make, and what file to change the permissions of before I run the program. I enter string literals into character arrays because you cannot initially an array with a variable. I need to figure out how to get the command line arguments I need into character arrays for the function to read. Once I can do this, most of my work will be done. If I can complete this relatively soon, I should be in good shape to complete the first project on time.

FEB 15, 2015

I found that our implementation of ls requires additional arguments to scan certain directories. It does not default to the current directory as the unix version does. So that takes care of that issue that I was having. We worked on it a little bit more last week.

I also finished my project. I got the command line arguments to process correctly as strings. I found a way to effectively store input from the command line into character arrays for the program to read from, in order to modify file permissions. After that, getting the verbose argument to work was the most difficult. the help and version were simple enough. I pretty much had to double the size of the program when I added in that argument. At the end of the day though, The program works as intended. I also feel a lot more comfortable browsing manual pages and looking for specific solutions to problems that I encounter.

CONTENT QUESTIONS

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
  • Why was this significant?
  • What concepts are you dealing with that may not make perfect sense?
  • What challenges are you facing with respect to the course?
blog/spring2016/pgrant3/journal.1455596307.txt.gz · Last modified: 2016/02/16 04:18 by pgrant3