From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JhnZC-0005CA-Ef for garchives@archives.gentoo.org; Fri, 04 Apr 2008 15:10:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C3E3EE08E2; Fri, 4 Apr 2008 15:10:56 +0000 (UTC) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by pigeon.gentoo.org (Postfix) with ESMTP id 80342E08E2 for ; Fri, 4 Apr 2008 15:10:56 +0000 (UTC) Received: by wf-out-1314.google.com with SMTP id 27so96471wfd.10 for ; Fri, 04 Apr 2008 08:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=Pa3AsDSOSQXoiD9dUOX3nJkhANtAYWR363nqbt9T1D4=; b=EvKVIfiP9ETHQmyQj4YHfwYUBeZ/x+K1qHy+wW2VUxDjmjVFLn3XpTNERwPqqcxAEfigdColk+u0AD1UbCluaZXQAHZvKlQRzjIeOxnSe2wUvVFw4OuovJ/wYub/c1Mf3vgOGamW9q+6qvkigRw8NcW4SiZz1Phk8WFxoQ/X64M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=S1ZSMNlVa1BL0sxYQElAwHA1FUb8g+OFDXAHWC5b9yHDasF2hqlhyAttE1pEc4YfMLhtO2B4mykDHQEp6BPLs9idSTdbF7i/l3Goh82+akib/e/yoCvItNEvwIZry6vO5wdPMmfMWgM/dnmnol0wYExNNAaP/TwWJFB98O54RJE= Received: by 10.142.77.11 with SMTP id z11mr995625wfa.98.1207321855977; Fri, 04 Apr 2008 08:10:55 -0700 (PDT) Received: by 10.142.215.18 with HTTP; Fri, 4 Apr 2008 08:10:55 -0700 (PDT) Message-ID: <2fcf3fa50804040810g111e8369v69e62f0427b94534@mail.gmail.com> Date: Sat, 5 Apr 2008 10:40:55 +1930 From: "Francisco Rivas" To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] [OT] mkdir in a C program? In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5594_9276785.1207321855982" References: X-Archives-Salt: 6b42cd1a-6397-4aa6-82d6-e1be61532dc2 X-Archives-Hash: 841430d7d01be55a1b7ae90d0a18aeb5 ------=_Part_5594_9276785.1207321855982 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I found this : #include int main(int argc,char **argv){ if (argc < 2) exit(1); mkdir(argv[1],0777); return 0; } http://gd.tuwien.ac.at/languages/c/programming-dmarshall/node20.html I hope that can help you :D On Sat, Apr 5, 2008 at 10:27 AM, Denis wrote: > Does anyone know if a directory can be created from inside a C program > and how that is done? Suppose I run the code from my own directory > /home/mydir, and I want the code to create a directory > /home/mydir/mydata, where data is to be written, what would the format > for such a command be? Also, when you write files to > /home/mydir/mydata, do i put in something like "./mydata/filename" as > the filename to open/write? > > Many thanks! > Denis > -- > gentoo-user@lists.gentoo.org mailing list > > -- Francisco Rivas http://www.vaslibre.org.ve - And on the seventh day God said :wq and then make http://beck3r.wordpress.com/ Linux User (New) : #448324 Linux Machine (New) : 355187 --- 4to Congreso Nacional de SL http://www.cnsl.org.ve/tiki-index.php?page=carabobo ------=_Part_5594_9276785.1207321855982 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I found this :

#include<sys/stat.h>

int main(int argc,char **argv){
if (argc < 2) exit(1);
mkdir(argv[1],0777);
return 0;
}
http://gd.tuwien.ac.at/languages/c/programming-dmarshall/node20.html

I hope that can help you :D

On Sat, Apr 5, 2008 at 10:27 AM, Denis <denis.che@gmail.com> wrote:
Does anyone know if a directory can be created from inside a C program
and how that is done?  Suppose I run the code from my own directory
/home/mydir, and I want the code to create a directory
/home/mydir/mydata, where data is to be written, what would the format
for such a command be?  Also, when you write files to
/home/mydir/mydata, do i put in something like "./mydata/filename" as
the filename to open/write?

Many thanks!
Denis
--
gentoo-user@lists.gentoo.org mailing list




--
Francisco Rivas
http://www.vaslibre.org.ve
-
And on the seventh day God said :wq and then make
http://beck3r.wordpress.com/
Linux User (New) : #448324
Linux Machine (New) : 355187
---
4to Congreso Nacional de SL
http://www.cnsl.org.ve/tiki-index.php?page=carabobo ------=_Part_5594_9276785.1207321855982-- -- gentoo-user@lists.gentoo.org mailing list