[comp.sys.acorn] possible bug in filer_opendir

gilbertd@p4.cs.man.ac.uk (Dave Gilbert) (05/31/91)

Someone has asked me to post the following article - here it is with
his email address - please post replies to this group or mail him - not me.

Simon Levitt <CCA90031@UK.AC.BIRMINGHAM.COMPUTER-CENTRE.IBM3090>
Subject: Re. Filer_OpenDir

I have a small problem with the Filer_OpenDir command.
I have been trying for a while to get !TinyDirs to install
directories on the icon bar from its startup... I have found
out that you do this by passing in the directories to the
application of start up e.g *!TinyDirs <DirName> <DirName> ....
This seems to work at first, but when clicking on the icon on the
Icon Bar the filer window just has the <DirName> as it's title
and not the full directory path...
So I had the idea of giving !TinyDirs the full directory pathname
when it is started. This seems to work until you click on the
icon.... The Filer gives you an error Filing system not present
or something simular. After a bit of investigation I found the
problem It seems that using a system variable in File_OpenDir
doesn't work properly, It doesn't seem to expand it!
e.g
  Set Directory$Dir adfs::14_45_Fri.$
  Filer_OpenDir <Directory$Dir>.Directory

  won't work whereas

  Filer_OpenDir adfs::14_45_Fri.$.Directory

  does!!!!

Am I doing something very stupid or is the problem in Filer_OpenDir
command???

Cheers,

Simon Levitt.
-- 
-------------------------------------------------------------------------------
- Dave Gilbert - gilbertd@p4.cs.man.ac.uk - The MTBF of a piece of equipment  -
-                G7FHJ@GB7NWP             - is inversly proportional to its   -
------------------------------------------- importance                        -

nbvs@cl.cam.ac.uk (Nicko van Someren) (06/01/91)

In article <gilbertd.675693695@p4.cs.man.ac.uk> gilbertd@p4.cs.man.ac.uk (Dave Gilbert) writes:
>
>Someone has asked me to post the following article - here it is with
>his email address - please post replies to this group or mail him - not me.
>
>Simon Levitt <CCA90031@UK.AC.BIRMINGHAM.COMPUTER-CENTRE.IBM3090>
>Subject: Re. Filer_OpenDir
>
>  Set Directory$Dir adfs::14_45_Fri.$
>  Filer_OpenDir <Directory$Dir>.Directory
>
>  won't work whereas
>
>  Filer_OpenDir adfs::14_45_Fri.$.Directory
>
>  does!!!!
>
>Am I doing something very stupid or is the problem in Filer_OpenDir
>command???

Each command provided by a module has a byte full of 8 flags to specify if
wether each of the first 8 parameters get passed through the GSTrans code to
expand things like system variables.  Acorn have not set the flag for the 1st
parameter of Filer_OpenDir so you can not pass it a system variable for the
directory name.  The following code can be assembled and saved with type
"Utility" as the command Do

  MOV   R0,R1
  MOV   R1,R12
  MOV   R2,#&100
  SWI   "OS_GSTrans"
  MOVVC R0,R1
  SWIVC "OS_CLI"
  MOV   PC,R14

Then at least you can type things like 'Do Filer_OpenDir <Directory$Dir>' and
the GSTrans will be done by the Do before the parameters get passed on to the
Filer_OpenDir.

Sorry to repeat myself by posting this code again but I copuld not find the 
original article to reffer to.
+-----------------------------------------------------------------------------+
| Nicko van Someren, nbvs@cl.cam.ac.uk, (44) 223 358707 or (44) 860 498903    |
+-----------------------------------------------------------------------------+

Julian.Wright@comp.vuw.ac.nz (Julian Wright) (06/01/91)

|>   Set Directory$Dir adfs::14_45_Fri.$
|>   Filer_OpenDir <Directory$Dir>.Directory
|> 
|>   won't work whereas
|> 
|>   Filer_OpenDir adfs::14_45_Fri.$.Directory
|> 
|>   does!!!!
|> 
|> Am I doing something very stupid or is the problem in Filer_OpenDir
|> command???

No, you aren't crazy... the problem is with Filer_OpenDir. There is a
way around it however. Simply define an alias as follows:

*Set Alias$Filer_OpenDir
	Set Alias$OD "%Filer_OpenDir %*0"|mOD|mUnsetAlias$OD|m

and the _alias_ expansion when the temp command OD is created will do
what we want. Remember that if you put this in an obey file it will have
to be:
	Set Alias$OD "%Filer_OpenDir %%*0"||mOD||mUnsetAlias$OD||m
or something like that. I can never remember what combination of double
"|"s and double "%"s to use when defining aliases in obey files... :-(

    Cheers, Julian.
-- 
;`````````````````````````````````````````````````````````````````````````````;
; I would if I could but I can't so I won't but I might if I find I can later ;
;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;
jwright@comp.vuw.ac.nz       		       julian@bridge.sideways.gen.ac.nz