🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.rexx
10 messages
10 total messages Started by jwrugo jwrugo Sat, 06 Apr 1996 10:53
How to set/change Current Directory ???
#4573
Author: jwrugo jwrugo
Date: Sat, 06 Apr 1996 10:53
25 lines
1010 bytes
Hi all,

Can someone help me with setting the current directory?  
My problem is that I want to:

1. check for a file(s)
2. Delete File(s)
3. Write to File(s)

in a directory one below my current postition, such as 
\subdirectory

I can't seem to find a way to get there.  I've used 'cd .\directory',
but this doesn't seem to keep me in the subdirectory.  I've tried
'dir .\directory > filename' and this works but of course doesn't 
actually change the directory and make it current.  I just did that
for testing.

Any help would be apprecieated,
John.


/------------------------------------------\
jwrugo@monmouth.com
Monmouth Internet
Re: How to set/change Current Directory ???
#4568
Author: chron
Date: Sat, 06 Apr 1996 07:34
8 lines
828 bytes
In OS/2 REXX, the directory() function will change both drive and directory in a single call.
 I was able to change to a directory "temp" under my current directory with the statement:

   code = directory("TEMP")

There was no need to reference the current directory (".") although that should work as well.
 What you posted should work, but there may be another problem with the program.  Can you post
a code fragment?
Re: How to set/change Current Directory ???
#4580
Author: terrell Dr. Dirk Terrell
Date: Sat, 06 Apr 1996 19:41
15 lines
1200 bytes
In <4k5iem$lp9@news.monmouth.com>, jwrugo (jwrugo) writes:
>Can someone help me with setting the current directory?  

You didn't state what OS you're on, but under OS/2 you use the
DIRECTORY() function. The online help gives an example that
is very similar to what you want to do.


--------------------------------------------------------------
Dirk Terrell,  Poole-Terrell Consulting, maintainers of
The Aquatic Center web page   - http://www.gnv.com/AC/
The Lloyd Bailey's Scuba Page - http://www.gnv.com/LB/
The Cyberspace Yellow Pages   - http://www.gnv.com/CYP/cyp.htm
The Gainesville Web           - http://www.gnv.com
--------------------------------------------------------------
Re: How to set/change Current
#4664
Author: FREDERICK SOHN
Date: Tue, 09 Apr 1996 19:17
14 lines
837 bytes
JWRUGO:

   You ask how to change to a directory where you want do things.

   My REXX is IBM's version for DOS.  A simple one-liner seems to work
fine:

      'call cd [target directory]'

   Hope this helps.

                                                 Fred

 * OLX 2.1 TD * frederick.sohn@consultant.com
Re: How to set/change Current
#4683
Author: Greg Goss
Date: Sun, 14 Apr 1996 09:02
12 lines
757 bytes
frederick.sohn@moondog.com (FREDERICK SOHN) wrote:

>JWRUGO:
>   You ask how to change to a directory where you want do things.
>   My REXX is IBM's version for DOS.  A simple one-liner seems to work
>fine:
>
>      'call cd [target directory]'
>
>   Hope this helps.

This does not word in Regina/win32
Re: How to set/change Current
#4691
Author: warren
Date: Mon, 15 Apr 1996 05:50
19 lines
977 bytes
In <3170a4fb.72659716@199.60.229.3>, oreo@mindlink.bc.ca (Greg Goss) writes:
>frederick.sohn@moondog.com (FREDERICK SOHN) wrote:
>
>>JWRUGO:
>>   You ask how to change to a directory where you want do things.
>>   My REXX is IBM's version for DOS.  A simple one-liner seems to work
>>fine:
>>
>>      'call cd [target directory]'
>>
>>   Hope this helps.
>
>This does not word in Regina/win32

thisdir='q:\whatever.in.the.heck.you.want'
nowdir=thisdir

Warren
http://www.borg.com/~warren
Re: How to set/change Current
#4712
Author: Greg Goss
Date: Tue, 16 Apr 1996 05:45
18 lines
1213 bytes
warren@borg.com wrote:

>In <3170a4fb.72659716@199.60.229.3>, oreo@mindlink.bc.ca (Greg Goss) writes:
>>frederick.sohn@moondog.com (FREDERICK SOHN) wrote:

>>>      'call cd [target directory]'
>>This does not word in Regina/win32
>
>thisdir='q:\whatever.in.the.heck.you.want'
>nowdir=thisdir

Warren's answer is not particularly verbose.  I think he is suggesting
that I use a full path specification on all DOS calls rather than a
CD-relative one.  This will solve my immediate need (thanks), but I'd
still like to have a CD if anyone has any suggestions.

At least using fully specified file names is better than my previous
best solution of the program calling itself in the new directory.	
Re: How to set/change Current
#4714
Author: warren
Date: Tue, 16 Apr 1996 08:13
25 lines
1523 bytes
In <3172dbaf.30328679@199.60.229.3>, oreo@mindlink.bc.ca (Greg Goss) writes:
>warren@borg.com wrote:
>
>>In <3170a4fb.72659716@199.60.229.3>, oreo@mindlink.bc.ca (Greg Goss) writes:
>>>frederick.sohn@moondog.com (FREDERICK SOHN) wrote:
>
>>>>      'call cd [target directory]'
>>>This does not word in Regina/win32
>>
>>thisdir='q:\whatever.in.the.heck.you.want'
>>nowdir=thisdir
>
>Warren's answer is not particularly verbose.  I think he is suggesting
>that I use a full path specification on all DOS calls rather than a
>CD-relative one.  This will solve my immediate need (thanks), but I'd
>still like to have a CD if anyone has any suggestions.
>
>At least using fully specified file names is better than my previous
>best solution of the program calling itself in the new directory.	

True!  My reply was terse.  The syntax will make you current with ANY 
valid part of the directory structure in any drive you have available.

Warren
http://www.borg.com/~warren
Re: How to set/change Current
#4745
Author: dsdarrow
Date: Thu, 18 Apr 1996 04:33
14 lines
1394 bytes
>Warren's answer is not particularly verbose.  I think he is suggesting
>that I use a full path specification on all DOS calls rather than a
>CD-relative one.  This will solve my immediate need (thanks), but I'd
>still like to have a CD if anyone has any suggestions.
>
Take a look for the DIRECTORY built-in function. It's described in TRL
but it isn't mandated there. It DOES work on all implementations of 
REXX for Intel platforms that I've messed around with. (OS/2 REXX, PC 
DOS REXX, and Personal REXX for all Platforms). It might work in 
Regina too.

---------------------------------------------------------------------
Doug Darrow <dsdarrow@terminus.com> The Second Foundation - Lompoc,CA
---------------------------------------------------------------------
Re: How to set/change Current
#4792
Author: John Hopkins
Date: Sat, 20 Apr 1996 19:12
38 lines
1845 bytes
Greg Goss wrote:
> 
> warren@borg.com wrote:
> 
> >In <3170a4fb.72659716@199.60.229.3>, oreo@mindlink.bc.ca (Greg Goss) writes:
> >>frederick.sohn@moondog.com (FREDERICK SOHN) wrote:
> 
> >>>      'call cd [target directory]'
> >>This does not word in Regina/win32
> >
> >thisdir='q:\whatever.in.the.heck.you.want'
> >nowdir=thisdir
> 
> Warren's answer is not particularly verbose.  I think he is suggesting
> that I use a full path specification on all DOS calls rather than a
> CD-relative one.  This will solve my immediate need (thanks), but I'd
> still like to have a CD if anyone has any suggestions.
> 
> At least using fully specified file names is better than my previous
> best solution of the program calling itself in the new directory.


Perhaps I'm missing the point, but the following three lines get the 
job done for me, in OS/2 REXX:

'C:'
'CD \DIRNAME\SUBDIR'
'START NEWPROG.EXE'

If you need a relative reference, just adjust line two accordingly, 
(skip the initial "\").  I use the full pathname so I can be positive 
I'm where I want to be :).

Hope this is useful.

Sincerely,

John Hopkins
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads