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

[aclug-L] C questions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] C questions
From: Olwe Bottorff <galanolwe@xxxxxxxxx>
Date: Sun, 12 Mar 2006 12:40:10 -0800 (PST)
Reply-to: discussion@xxxxxxxxx

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


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