The C language uses radians instead of degrees when calculating angles. Humans should use radians as well, as they’re logical and easy to work with (radians, not humans). What surprises me, however, is that the C library lacks a defined constant for making the degree-radian conversion.
Continue reading
Author Archives: dgookin
Creating a File “in the Raw” – with Permissions
Way back in April, I concluded my series on the “raw” file functions with a program that created a new file — but one that had no permissions. Thanks to input from readers and research into file-permission functions, I have a solution to the puzzle.
Continue reading
Changing a File’s Permissions
In Unix-like operating systems, the chmod shell command alters a file’s permissions. From the C library, the chmod() function does the same thing.
Continue reading
Tic-Tac-Toe Evaluation – Solution
The insidious part of this month’s Exercise is writing a function that doesn’t count a stalemate as a win. It’s what happened to me for my first draft of a solution.
Continue reading
Examining File Type and Permissions
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
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