[aklug] Re: regarding permission bits

From: <bryanm@acsalaska.net>
Date: Fri Nov 21 2008 - 02:32:04 AKST

On Thu, November 20, 2008 2:21 pm, Christopher Howard wrote:
> On Thu, 20 Nov 2008, bryanm@acsalaska.net wrote:
>
>> On Wed, November 19, 2008 4:19 pm, Christopher Howard wrote:
>>> Also, as a point of curiosity: I've seen that some files (like
>>> directories) have a 'file
>>> type' character. Does this take up the space of a full character? Is it
>>> like a 1 byte C char; or is this just a system representation of a smaller
>>> set of bits? And is there a way I can manipulate those bits?
>>
>> You probably don't want to directly manipulate the file type.
>> What would it mean to change a text file to a directory, or a
>> directory to a device file? Each file type can be created with
>> its appropriate utility:
>>
>
> Well, part my idea in understanding how to directly manipulate the file
> type would be to better understand how the layout and location of the
> appropriate bits worked. Another idea would be able to learn how to
> generate such file types without relying on an intermediate GNU utlity,
> which could be more efficient inside of a program, I imagine.
>
> I've been learning lately in C how to modify individual bits of stored
> data, and was exploring various possibilities of how I might apply this
> knowledge.

I'm not sure where the file type is stored. You've got me wondering
now, too. :)

For creating particular file types from within a program, you can
use system calls -- subroutines provided by the C libraries for
specific jobs of many kinds.

Type "man -k mkdir". The (1) on the first line indicates "section 1"
of the man pages, which are the commands you might type at the prompt.
The (2) indicates a system call, which you would use from a program.
"man 2 mkdir" shows you the man page from section 2, which tells you
how to use the system call.

Real experts, please correct me if I'm wrong. And I'll keep trying
to find info on the file type storage.

--
Bryan Medsker
bryanm@acsalaska.net
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri Nov 21 02:32:22 2008

This archive was generated by hypermail 2.1.8 : Fri Nov 21 2008 - 02:32:23 AKST