From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30583 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Create a directory using tex Date: Tue, 29 Aug 2006 21:09:22 -0400 (EDT) Message-ID: References: <44F3E935.8000404@elvenkind.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1156900195 7464 80.91.229.2 (30 Aug 2006 01:09:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Aug 2006 01:09:55 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 30 03:09:48 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1GIEaO-00061p-QS for gctc-ntg-context-518@m.gmane.org; Wed, 30 Aug 2006 03:09:45 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 39BC71FDFA; Wed, 30 Aug 2006 03:09:44 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 22951-07; Wed, 30 Aug 2006 03:09:33 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 645731FDFB; Wed, 30 Aug 2006 03:09:33 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 74BF91FDFB for ; Wed, 30 Aug 2006 03:09:29 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 22927-05 for ; Wed, 30 Aug 2006 03:09:23 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with SMTP id E54401FDFA for ; Wed, 30 Aug 2006 03:09:20 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY hackers.mr.itd.umich.edu ID 44F4E53E.60E5.14241 ; 29 Aug 2006 21:09:19 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: <44F3E935.8000404@elvenkind.com> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:30583 Archived-At: On Tue, 29 Aug 2006, Taco Hoekwater wrote: > Aditya Mahajan wrote: >> Hi, >> >> I want to create a macro that writes files in a sub directory. >> If the directory is already created, things work fine. However, if the >> directory is not there, tex complains >> >> ! I can't write on file .... >> >> Please type another output file name: >> >> Is there a way I can ask tex to create a directory if one does not >> exist? > > Not with TeX, but you can use \write18 or \installprogram to run a > system command. Can I ask TeX to check if a directory exists or is writable. I want it to give an informative message if the directory does not exist. Or is there a way to check if a file is writable, so that I can do \doiffilewritable{dir/tempfile}{\donothing}{\message{Warning}{Please create directory 'dir' \endinput} Aditya