The value returned as a file’s inode mode is difficult to interpret, as covered in last week’s Lesson. That is, unless you use the macros and defined constants available in the sys/stat.h
header file.
Continue reading
Author Archives: dgookin
Tic-Tac-Toe Evaluation
This month’s Exercise may seem like a repeat of the Exercise “We Have a Winnah!” from July of 2013. It’s not.
Continue reading
Finding File Permissions
All files carry with them something called an inode, which contains file data beyond the file’s name and its contents. The inode references the file’s size, its timestamps, and the file type or mode. It’s this file mode that determines how the file is used, which users can access the file, and what can be done with the file when accessed.
Continue reading
Maximum Arguments
Often times I poke into the C language, removing its crude veneer to look deeper into its guts — the digital protomatter that C and all programming languages devolve into when processed by the CPU. One of the things I discovered is that there is no solid limit to the number of arguments a function can have.
Continue reading
C Blog 7th Anniversary
The first post was made on this blog April 13, 2013.
Continue reading
Crossing Between Formatted and Unformatted File Functions
One of the reasons behind the low-level open() function is to access non-traditional files. This stems from the UNIX environment’s treatment of every device as a file. Sometimes you need low-level access to accomplish specific tasks, such as accessing a device driver. Yet, in the C language universe, an interesting crossover is provided between low-level raw file access and formatted file access.
Continue reading
No Nines – Solution
The challenge for this month’s Exercise is to determine whether an integer, 1 to 100, is divisible by nine or contains the digit ‘9’. It seems like an easy puzzle for a C programmer to solve, but what I found interesting was crafting the output — specifically when a number both contains ‘9’ and is divisible by nine.
Continue reading
Writing File Data in the Raw
Along with open() as a raw file access function comes raw functions to read and write data. Last week’s Lesson covered the read() function. This week covers its twin sibling, write().
Continue reading
No Nines!
Like many innocent and silly math games, No Nines is nerdy to play but fun to code. The game works like this:
Continue reading
Raw Reading File Data
When you use the fopen() function to open a file for reading, a buncha functions are available for reading data: fread(), fgets(), fgetc(), and others I’m too lazy to look up. Reading files by using the open() function, however, gives you this choice: the read() function.
Continue reading