Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Console current path

 [1/5] from: jrdrp:blueyonder at: 17-Dec-2001 19:32


Hi all, Why does my console apparently change directory after an error occurs in program (halted etc.)? Console session example below show:->
>> do/args %myprogs/ftget.r "FTX1"
Program FTGet begin ["FTX1"] Invalid FTSE Index argument : FTX1
>> do/args %myprogs/ftget.r "FT1"
** Access Error: Cannot open /C/rebol/view/myprogs/myprogs/ftget.r ** Where: halt-view ** Near: do/args %myprogs/ftget.r "FT1"
>>
John

 [2/5] from: carl:cybercraft at: 18-Dec-2001 9:20


On 18-Dec-01, John R wrote:
> Hi all, > Why does my console apparently change directory after an error
<<quoted lines omitted: 9>>
> ** Near: do/args %myprogs/ftget.r "FT1" >>>
I've heard the reason, (from RT), but forgotten it. But if it happens, change your 'do path to a full path and your program will run again without you having to close the console down and start again. (No doubt someone could write you/us a reset-path function we could add to our REBOL startups?)
> John
-- Carl Read

 [3/5] from: holger:rebol at: 17-Dec-2001 12:24


On Mon, Dec 17, 2001 at 07:32:37PM -0000, John R wrote:
> Hi all, > Why does my console apparently change directory after an error occurs in
<<quoted lines omitted: 9>>
> ** Near: do/args %myprogs/ftget.r "FT1" > >>
That's a bug. Please submit it to feedback. 'do needs to switch directories in order to run the script (scripts expect their own directory to be current), but is supposed to switch back after the script has completed. Apparently that does not happen if an error occurs. -- Holger Kruse [holger--rebol--com]

 [4/5] from: al:bri:xtra at: 18-Dec-2001 9:24


John wrote:
> Why does my console apparently change directory after an error occurs in
program (halted etc.)?
> Console session example below show:-> > >> do/args %myprogs/ftget.r "FTX1"
<<quoted lines omitted: 6>>
> ** Near: do/args %myprogs/ftget.r "FT1" > >>
Rebol changes the current directory to %myprogs/ so that %ftget.r is running with the correct current directory. When the error occurs in %ftget.r, the current directory is still %myprogs/ so that's why the current directory seems to have changed for the console -- you're still in the context of %ftget.r, which is different from where you were before. I hope that helps! Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [5/5] from: carl::cybercraft::co::nz at: 18-Dec-2001 12:28


On 18-Dec-01, [holger--rebol--com] wrote:
> On Mon, Dec 17, 2001 at 07:32:37PM -0000, John R wrote: >> Hi all,
<<quoted lines omitted: 15>>
> script has completed. Apparently that does not happen if an error > occurs.
Just checked what feedback told me about this. (I submitted it way back in May 2000)... After running a script which exits with an error, the current directory becomes the one where the script was in. You can check this out with the WHAT-DIR command. I wasn't told then it was a bug so I've always assumed it's intended REBOL behaviour... -- Carl Read

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted