Re: Testing external file existance

From: Frederico Fonseca (real-email-in-msg-spam_at_email.com)
Date: 07/15/04


Date: Thu, 15 Jul 2004 22:19:35 +0100

On 15 Jul 2004 12:59:49 -0700, kjdkld@hotmail.com (Kris Dames) wrote:

>I use rmcobol85 on redhat linux and I need a way to verify from within
>my program that a user-specified file exists in a specific location on
>the filesystem. For example, if the user inputs the filename
>"myfile.txt" I need to check the /tmp directory for the file and tell
>the user if the file exists or not. Any help would be appreciated!

issue a "call "SYSTEM" using command-line" where command line is made
as

01 command-line pic x(2000).

.....

accept file-name

string "ls -l "
  file-name
  " > /tmp/temp-file"
  into command-line

call "system" using...

At this stage you read the "/tmp/temp-file" as a normal sequential
file and see if the file-name value appears there.
If so you can open that file.
 
   

Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com



Relevant Pages

  • open file (as variable) from macro
    ... User inputs a date etc., I add path in front of date and some other ... is, when I record the "open filename", it puts that one filename in my macro ... same file cuz it's recorded that way in the macro. ...
    (microsoft.public.excel.misc)
  • storing Outputto filename into a variable
    ... i was wondering if anyone knew how to store the filename a user inputs when they select a new file to output data too? ...
    (microsoft.public.access.macros)