X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Peter Brown Subject: Re: system mkdir Date: Thu, 1 Dec 2011 23:32:01 +0000 (UTC) Lines: 28 Message-ID: References: <20111128203357 DOT GB8758 AT ednor DOT casa DOT cgf DOT cx> <4ED3F409 DOT 5020309 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Eric Blake redhat.com> writes: > > On 11/28/2011 01:33 PM, Christopher Faylor wrote: > >> ?But can't find anything that will programatically create a directory > >> under Cygwin. > >> > >> ?Does anyone know how to do this? > > > > Yes. Use the mkdir() function. That is, in fact, very similar to how it > > should be done in Visual Studio too. > > For a temporary directory, mkdtemp() might be better than mkdir(); but > either way, you still have to use rmdir() to clean up after you are done. > This seems to work for me. int MySystem(char *s) { int answer; char syscmd[2048]; sprintf(syscmd,"cmd /c bash -c 'umask 0077;%s'",s); answer = system( syscmd ); return answer; } -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple