Jonathan Kaye wrote:
> # Stolen shamelessly from io.icn in the procs library
> if find("MS", &features) then
> slash := "\\"
> else
> slash := "/"
> datadir := ("Data" || slash)
> outdir := ("Output" || slash)
> infile := open(datadir || flnm || ".txt") | stop("blah blah blah")
> outfile := open((outdir || flnm || ".out"), "w") | ("blah blah blah")
>
> It may not always be necessary but it should be safe. Does this make sense?
Yes it does. Nicely stolen - I had forgotten about io.icn!
As a general note, one could also combine this with David's trick to
produce a general 'open()':
procedure OPEN(x[])
static slashIn, slashOut
initial {
slashIn := "\\"
slashOut := "/"
if find("MS", &features) then (slashIn :=: slashOut)
}
x[1] := map(x[1], slashIn, slashOut)
return OPEN!x
end
This is overkill for Jonathan's case, but may be generally useful.
(I'm a little leery of changing the real open since backslashes in
Unix filenames are presumably legal, if *highly* bad form...)
--
--
Steve Wampler [EMAIL PROTECTED]
The gods that smiled upon your birth are laughing now. -- fortune cookie
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group