From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30593 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Create a directory using tex Date: Wed, 30 Aug 2006 09:23:07 -0400 (EDT) Message-ID: References: <44F3E935.8000404@elvenkind.com> <44F53EA9.6090009@wxs.nl> 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 1156944220 5763 80.91.229.2 (30 Aug 2006 13:23:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Aug 2006 13:23:40 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 30 15:23:34 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 1GIQ2I-0003Bi-DK for gctc-ntg-context-518@m.gmane.org; Wed, 30 Aug 2006 15:23:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 46E0D1FE77; Wed, 30 Aug 2006 15:23:15 +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 08895-01; Wed, 30 Aug 2006 15:23:12 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 97BF31FE78; Wed, 30 Aug 2006 15:23:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E9FE91FE78 for ; Wed, 30 Aug 2006 15:23:08 +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 07344-01 for ; Wed, 30 Aug 2006 15:23:05 +0200 (CEST) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by ronja.ntg.nl (Postfix) with SMTP id C00691FE77 for ; Wed, 30 Aug 2006 15:23:04 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY hellskitchen.mr.itd.umich.edu ID 44F59135.F40FB.20438 ; 30 Aug 2006 09:23:03 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: <44F53EA9.6090009@wxs.nl> 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:30593 Archived-At: On Wed, 30 Aug 2006, Hans Hagen wrote: > Aditya Mahajan wrote: >> 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} >> >> > for a while there has been a way to ask for file characteristics > (x-dir-01 can be used to generate a clickable listing and x-dir-05 for > indentifying files) > > permissions were not part of that but easy to add, i'm generating you a > beta that has permissions added Thank you. I will play around with this and ctx preprocessing. Aditya > \usemodule[x][dir-05] > > \getfilestate{context.tex} > > \doifinstringelse{w}{\getvariable{filestate}{permissions}} > {writable} > {not writable} > > > \end > > > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com > | www.pragma-pod.nl > ----------------------------------------------------------------- > > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context > > > -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008