TIP: Click on subject to list as thread! ANSI
echo: os2user-l
to: All
from: Herbert Rosenau
date: 2005-04-03 06:54:02
subject: Re: REXX - Light My String ?

Don{ald} O. Woodall schrieb:
> In , on 03/30/2005 
>    at 07:23 PM, Herbert Rosenau  said:
> 
> Hi Herbert
> 
>      OK, I've taken care of a few other things and can get back to this
> again.
> 
> 
>>Don{ald} O. Woodall schrieb:
>>
>>>In , on 03/29/2005 
>>>   at 12:46 PM, Herbert Rosenau  said:
>>>
>>>Hi Herbert
>>>
>>>
>>>>Make things so simple as possible:
>>>
>>>     Sounds good to me.  However, my simple isn't always the other
>>>person's simple.
> 
> 
>>You are thinking much too complicated!
> 
> 
>      Sorry, that is as simple as I can get. :^)
> 
> 
>>Here is a simple procedure that does nothing as to read multiple drives
>>at once,....
> 
> 
>      Ooops, I have failed again to put things into proper context.
> 
>      Some people might characterize this whole exercise in an exercise in
> the absurd.
> 
>      You might say "keep it simple and just do:
> 
>                     XCOPY X: Y: /H/O/T/S/E/R/V ???"
> 
>      This is "MY" standard procedure for replacing / upgrading hard
> drives.  [ I have been working full time since December to upgrade 3 SCSI
> hard drives to the U160 interface. ]

And then you use a lot of complicated cmd commands to produce some 
intermediate files, raed and write them multiple times and hacking around.

That is more complicatet as neccessary.

>      So, the ability to do multiple hard drives at once it totally
> misdirected and useless.
> 
>      People keep wanting to drag files into the project.  By my definition
> of the project, files are totally excluded.
> 
>      My perception of how things should be can be blamed on Pie Face Billy
> Boy.
> 
>      Directory names should be UPPER CASE.
> 
>      File names should be "lower case."
> 
> NEW HARD DRIVE
> --------------
> 
>     1. SCSI host adapter Low Level Format.

Boot up into your host adapter BIOS. That will do the low level format.

>     2. SCSI host adapter verify.
>

Buut up to your host adapter BIOS. That will do the verify too.

>     3. OS/2 Long high level format.

Boing! You need to partitoning the drivee before. On LVM available 
systems you need to LVMing the partitons too (whereas in simplest case 
you can do both in one single step.

If you have to do that very often you can automate this too by writing 
a program that uses the LVM dll. Mut most ofen you would do that 
manually like you does the low level things.

You may even easy use LVM/fdisk on commandline in a simple cmd batch 
to partitonining (and LVMing the physical drive AND formatting the 
partitons/volumes.


>     4. Create / Install an UPPER CASE directory tree.

This step is superflous as this can be done while copying the data 
using REXX

>     5. XCOPY X: Y: /H/O/T/S/E/R/V


This is what the procedure I gave you can do.

change parse upper ......
to     parse lower ......
in the file section and the files are in lower case. Simple, eh.

Change the function that is given as do_what_you_like_with_the file to 
hold rc=syscopyobyect(sourcepath, destpath)
to copy the file currently handled insteat or plus the say already in

Insert a syscreateobject() in the directory section whereas you can 
use the path to the destination.

Hint: as you have always a full qualified path you have nothing more 
to do as changing the first letter (the drive letter) of the path to 
switch from source to destination path.



> MOVING ON
> ---------
> 
>      The above is my non-negotiable totally unreasonable procedure.

To maske things so simple as possible the only you have to do in a 
rexx procedure is to use REXX instead of commandline commands wherever 
possible.

True, the rexx procedure given handles only one drive at a time, but 
it is really easy to change it so that it reads the whole directory 
tree from one drive and creates all directories found on that on the 
other one AND upercase all diorectory names (regardless of they are 
containing spaces or some other legag characters, including spaces) 
AND lowercase all file names like uppercaseing all diretory names. As 
OS/2 handles file and directory names caseless you may attach an all 
uppercase directory while all chars lower case in the path. Only while 
create/copy the path and name has to be case sensitive to get the name 
on disk case sensitive written. Attaching it is always caseless. So 
lower/uppercase the full path is absolutely ok, because you will speak 
lowercase when you creates (means copying to destination) a file and 
uppercase when you creates a directory. No need to split a single file 
or a single directory name from the path as the directory handling 
will always have an upper and the file handling an lower path  of the 
missing (to create) segment.

>      As time goes I enhance things and learn how to do more
> and better things.

O.k., you have to do that. In repeat:
- low level things are done manually inside the adapter BIOS
- high level things are:
   - partitoning/LVMing can be done by commandline commands
   - formatting can be done by commandline commands
   - replication a whole drive can be done by the rexx
     command file I gave you in my last artikle, extended
     by the functions I sent you the artikle before. You can combine
     both in one single REXX script.
   - handling more than one single drive for copying is needed!
     except you says that a physical disk is used for a
     single partiton/volume only.
When your system drive should not be C: primary you would use 
fdsik/lvm commandline to create BM on the target drive too.

>      Right now I am growing from just doing DATA drive with my procedure
> to being able to do bootable operating system drives.

Oh, the procedure you got will be able to copy all and any data in all 
and any drives from one physical disk to another solong there are 
filesystems with the capability to write are installed on the system 
in one single run. That means you clones the whole disk containing 
FAT16, HPFS, JFS or FAT32 or NTFS in source and FAT16, FAT32, HPFS or 
JFS formatted drives on the target, whereas only the system drive must 
be formatted to the same filesystem as the source. You may convert 
data drives from one filesystem to another on the fly.

> 
>>        starting with the root directory and there calls a  simple
>>procedure with each file there with full qualified path. The procedure
>>does nothing than list the path/file on screen yet.
> 
> 
>      As I may have just stated for the first time, the above is a way off
> target tangent.

It is on YOU to modify the procedure a very little bit to handle 
source and target instead of one drive letter only. It is really easy 
to do so. The procedure does only anything to get each file and 
directory on the source separately in hand, knowing exactly that it is 
a file or directory to hande both file and directory entry accordingly 
its type.

Maybe you would create another drive stem containing the drive letter 
sof the target drive in the same sequence as the source to have a 1:1 
direction from source to target.

Using that procedure you would be able
- copying the whole physical drive while handling logical drive by 
logical drive, file by file, directory by directory.

When you have to handle windows or linux partitons you would even able 
to port this procedure to REGINA (Win) or Linux REXX and clone there 
(be warnded: impossible to get windows booted! by that because windows 
is based on the physical layout of the drive, so it would not boot 
anymore when some parts of the disk gets moved to another physical 
location on the drive).

> 
>>After listing all files it will list all directories and for each 
>>directory call itself to list all files therein and thereafter call  all
>>directories to list.......

> 
>>No need to fiddle around with writing intermediate files only to read 
>>them to get what you needs.
> 
> 
>      I kindly disagree.  It is my definition of Keep It Simple.  One
> reason I am doing this in a series of programs is:  This way I can write a
> series of programs I can understand and write.  Trying to do it all at
> once is more than I am willing to tackle right now.

This shows that you have not even tried to look into the procedure. 
You have only to
- insert ONE REXX call to get a file copied
- insert ONE REXX call to get a directory created
- change ONE word (toupper to tolower) to get all file names in lower 
case instead of upper case
- insert another stem containing drive letters in the same order as 
the existing one
- change the first letter of the current path to the one in index of 
the drive list to the one in the second (new) drive list to make the 
target path from the source path after copying the path into another 
variable.

Resulting in a full logical clone of the physical disk of all drives 
OS/2 or eCS can write to.

Learn to understund what you've gotten from me and you will see how 
easy the work can be done with one single procedure

> 
>>Simply recurse through all directories and work with each file and 
>>directory one by one.
> 
> 
>   
> 
>      Sorry, I don't mean to be thick headed.  You haven't yet convinced me
> you are aiming at the same target I am.  I probably have correctly
> describe my goal to you before.

I don't know - but you are seems unable to understund a bit REXX. Read 
the information you have on your system about REXX. There is nothing 
that is not documented well in the only handbook "The Procedure 
Language OS/2 REXX already installed with the base install of your system.



>      Also, I run into a problem, only mentioned once, which you have
> acknowledged or discussed.
> 
> 
>>It lefts to you to handle the files other than only list theyr path.  It
>>lefts to you to handle each directory name other than list its content.
> 
> 
>>Any filename will be converted to uppercase while looking at it.
> 
>      To repeat; for the purpose function effect I am trying to accomplish
> here, files names do not enter into the picture. 

You tells the contrary above and below.


  My preference is the
> have file names be "lower case." 

parse lower... instead of parse upper.... does the trick


  However, I am not currently trying to or
> wanting to touch file names at this time.  I have not thought things
> through enough to start messing with them.

So left of the parse.... and the names will NOT converted.

> 
>>Something above can written much shorter but I have decided to use the 
>>longest form because it results in better readability.
> 
> 
>>You've gotten a hint how to create a directory or file with and  without
>>spaces in its path or name. The procedures above handles  spaces in path
>>and name well too.
> 
> 
>>Don't use cmd.exe when you have REXX APIs who does things much easier.
> 
> 
>>Hint: dont call procedures who likes to give a result saying
"fail" or 
>>"success" in theyr result. You would have a need to check
it to avoid 
>>some possible misbehavior.
> 
> 
>      What is a procedure? 

read the REXX handbook.

>>The procedures above are tested and debugged.
> 
> 
>>It is time now for you to learn really REXX to get your work done -
>>quicker
>>- more errorfree
>>in total much better.
> 
> 
>      I am trying to learn as fast as I can.  I do not function under
> direst or pressure.  I have been slow all my life.  I am now at a place
> where I don't have to and have no reason to do anything.

I had tried to give you some basics. It is on you to understund that. 
You'll see that using plain REXX instead of mixing up it with cmd 
functions makes many things much simpler and easier.

At least you sees that you have really no need to create intermediate 
files and working on them multiple times. There is even no need to 
manipulate a path other than changing the drive letter and change the 
whole path to either upper or lower case to fullyfy any requirement 
you have for that instead to create, read, change, reread, 
rechange..... lots of intermediate files.

>      See more in a new thread.
> 
>      Thanks
> 


-- 
Tschau/Bye

Herbert Rosenau                    eCS 1.2 Deutsch bestellen bei
EDV Beratung & Programmierung           http://pc-rosenau.de
Eichelsdorfer Str. 15                   http://ecomstation.de
97461 Hofheim i.UFr.

Tel: 49-9523-502834
Fax: 49-9523-502823                     http://www.dv-rosenau.de/


 
Yahoo! Groups Links

 To visit your group on the web, go to:
    http://groups.yahoo.com/group/os2user/

 To unsubscribe from this group, send an email to:
    os2user-unsubscribe{at}yahoogroups.com

 Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




---
* Origin: Waldo's Place USA Internet Gateway (1:3634/1000)
SEEN-BY: 633/267 270 5030/786
@PATH: 3634/1000 12 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.