Complete.Org: Mailing Lists: Archives: discussion: March 2006:
[aclug-L] Re: C questions
Home

[aclug-L] Re: C questions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] Re: C questions
From: "Jonathan Hall" <flimzy@xxxxxxxxxx>
Date: Sun, 12 Mar 2006 15:24:23 -0600 (CST)
Reply-to: discussion@xxxxxxxxx

Permissions are represented in octal.  0755 is octal for 493.  Certianly
you can assign the value to a numeric variable, and pass that to the
mkdir() function.



> I'm trying to create a directory in C where I use
>
> mkdir(const char *pathname, mode_t mode);
>
> I'd like to take a simple string "0775" and somehow
> use that for the mode argument. I'm getting the
> permissions as a char string from a file. Now, if you
> do this:
>
> mkdir ("mydir", 0755); /* 0755 directly typed in */
>
> It works fine. But I can't figure out how to get a
> variable (char or otherwise) with 0755 in it that
> mkdir will accept. Of course I could parse each letter
> and build the variable, but that just isn't very
> elegant.
>
> I'm also trying this for utime(), i.e., trying to feed
> the utimbuf argument to utime from a string I'm
> getting from a file.
>
>
> LB
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> -- This is the discussion@xxxxxxxxx list.  To unsubscribe,
> visit http://www.complete.org/cgi-bin/listargate-aclug.cgi
>
>


-- This is the discussion@xxxxxxxxx list.  To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]