On Thu, 31 Mar 2016, at 08:03, Jon Wolfers wrote: > Hi Jeremy, > > I'm not sure why you expect this to work. > > In dos* you can get back the value of an environment variable by encasing > it in '%'s > In rexx you get it back using the value bif > > so where you build a string to be interpreted by dos* using '%TEMP%' you > would substitute value('TEMP',,'ENVIRONMENT') in rexx. > In rexx the string '%TEMP%' is just a string and if it weren't then all > sorts of other things would stop working.
Ah... I was too close to the problem, seeing it as a "temporary file issue". You're saying simply that oorexx doesn't support any use of environment variables in filepaths. I suppose I expected it to work because both the 'dos' command window and Windows GUI support use of percent-enclosed environment variable names, so I assumed the support was there at a fundamental level in the OS. I hadn't noticed however that a percentage sign is a valid character in a filename! So for example if these files exist: Directory of C:\Users\DAYTOD~1\AppData\Local\Temp 21/03/2016 19:06 447,997 20160321 fdc - so%wpo%ds - 9 letters.txtplain 31/03/2016 02:55 426,360 20160321 fdc - sowpods - 10 letters.txtplain 21/03/2016 19:02 87,346 20160321 fdc - sowpods - 5 letters.txtplain 21/03/2016 19:04 296,181 20160321 fdc - sowpods - 7 letters.txtplain 21/03/2016 19:05 401,610 20160321 fdc - sowpods - 8 letters.txtplain one can use dir to find just the first one by C:\>dir "%TEMP%\20160321 fdc - so%WPO%ds*" Volume in drive C has no label. Volume Serial Number is F607-7930 Directory of C:\Users\DAYTOD~1\AppData\Local\Temp 21/03/2016 19:06 447,997 20160321 fdc - so%wpo%ds - 9 letters.txtplain 1 File(s) 447,997 bytes 0 Dir(s) 240,379,101,184 bytes free I rather expected the 'dos' interpreter to replace the "%WPO% in the dir command with a null string, so it would be treated as: dir "%TEMP%\20160321 fdc - sods*" and find nothing, and that I'd need to escape the embedded percent signs with "^" chars. But it worked. Even (no quotes around the parameter) this works: dir %TEMP%\*%WPO%ds* So I suppose that whatever it is in 'dos' and the GUI that scans along a string and replaced each %something% with its value has been written to leave them alone if there's no value. -- Jeremy Nicoll - my opinions are my own. ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 _______________________________________________ Oorexx-users mailing list Oorexx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-users