comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » existing directories
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: existing directories [message #14161 is a reply to message #14087] Tue, 26 January 1999 00:00 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Martin Schultz wrote:

> Hi,
>
> maybe something is blocking my mind right now, but I just can't think
> of a good (platform independent) way to test whether a directory exists
> or not. I am trying to write an 'install.pro' routine (not too fancy but
> at least with automatic backup of an old version and automatic creation
> of the target directory if not there). Actually, since I am spawning
> quite a few unix commands anyhow, a good Unix solution would be fine,
> too.

Dear Martin

is_dir will return 1 if directory exist and 0 if not. It is platfom
independent (AIX, NT tested)

; Copyright (c) 1999, Forschungszentrum Juelich GmbH ICG-1
; All rights reserved.
; Unauthorized reproduction prohibited.
; This software may be used, copied, or redistributed as long as it is not
; sold and this copyright notice is reproduced on each copy made. This
; routine is provided as is without any express or implied warranties
; whatsoever.
;
;+
; NAME:
; is_dir
;
; PURPOSE:
; Test if directory exist
;
; CATEGORY:
; PROG_TOOLS
;
; CALLING SEQUENCE:
; Result = is_dir(path)
;
; INPUTS:
; path: The variable to be tested.
;
; OUTPUTS:
; This function returns 1 if directory exist else it returns 0
;
; EXAMPLE:
; dir='C:\temp'
; PRINT, is_dir(dir)
; -> 1
;
; MODIFICATION HISTORY:
; Written by: R.Bauer , 26.01.99
;-


FUNCTION is_dir,path
errvar=0
CATCH,errvar
IF errvar NE 0 THEN RETURN,0
CD,curr=curr,path
CD,curr
RETURN,1

END





>
>
> BTW: Has anyone written a routine like this before (which is
> documented)? What I have in mind (and working in a rudimentary version)
> is this:
> * create target directory if necessary
> or copy all files in target directory into BACKUP<date> directory
> * copy all files from a masterdirectory (either by listfile or file
> mask) to target directory
> or extract them from the RCS system (version control system).
>
> This would be a generic install routine which would come to life by
> package specific caller routines (e.g. install_gamap.pro).
>
> Thanks,
> Martin.
>

Did you thought on a self installing of an zip/exe/tar file with included
directories?
If you try this way you have to test only if an old version was installed
previously.


Regards

R.Bauer
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Concurrent CORBA calls
Next Topic: Re: ls and PV-WAVE problem on HP-UX 10.20

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 21:13:39 PDT 2025

Total time taken to generate the page: 1.60103 seconds