12 April 2015, 17:22 | #1 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
Check if PROGDIR: exists?
Hi,
how can I test if the PROGDIR: exists, but without using Lock()? It is not in the assigns list. The problem is, that when developing in AsmOne or Asm-pro, there is no PROGDIR:. that's it thanks ags |
12 April 2015, 18:04 | #2 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 482
|
Well, your program is running, therefore the directory it is started from must exist ?!?
|
12 April 2015, 18:06 | #3 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
That's what we expect. And when it runs, then it works. I dunno what AsmOne/Pro are doing but when being inside and developing, there is no PROGDIR: available.
|
12 April 2015, 18:13 | #4 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
Ah, I just found the dos.library function GetProgramDir(). But it's buggy, says the doc.
|
12 April 2015, 18:28 | #5 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
btw: Where is the ENV: dir under OS 4+? I cant see it among the assigns anymore.
|
12 April 2015, 19:02 | #6 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,045
|
It's not a directory any more, it is a handler.
|
12 April 2015, 19:08 | #7 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
Thanks, and how can I check if ENV: handler existst w/o the Lock() function? I want no req showing up.
ps: Ah, maybe I should use LockDosList() with LDF_DEVICES! Last edited by AGS; 12 April 2015 at 19:17. |
12 April 2015, 19:20 | #8 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
This is one of many problems with ASM-One/ASM-Pro. Your program runs as a subroutine, which also means that if you started ASM-One from CLI, then you are a subroutine of a CLI process, and if you started from Workbench then you are a subroutine of a Workbench process, and you can't touch and work with the process and its data as if it were your own.
One work-around people often use is a simple equate, "FROM_ASMONE=1" or similar, and a set "if-else-endif" clauses, to handle the problematic cases differently when running from inside ASM-One. The best solution in my opinion is to ditch ASM-One. If you want to do serious development, like you are doing with XoXo, then put ASM-One back in the toy-box where it belongs, and pick up a set of proper tools instead. By the way, if you want a lock on your program directory then you can just use Process.pr_HomeDir. |
12 April 2015, 19:22 | #9 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
I am not using AsmOne/Pro myself. I just got a mail that soemone has this problem with my GUI.
|
12 April 2015, 19:24 | #10 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,045
|
Quote:
You shouldn't lock it anyway. Only use GetEnv and SetEnv to access it. To avoid a requester you can set pr_WindowPtr to -1. To find ENV on the DOS list, just search for any type, not only LDF_ASSIGNS. BTW, the same can happen on OS3, too, if the user has installed HappyEnv or similar. |
|
12 April 2015, 19:27 | #11 | |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
Quote:
|
|
12 April 2015, 21:10 | #12 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,045
|
What for a check? You need no check. Like I said, use GetEnv and SetEnv, nothing else, no check whatsoever. Do no expect ENV to be a file system.
|
12 April 2015, 21:14 | #13 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
No check, I meant it is good to search (check) for both ASSIGNS and DEVICES. What I am doing is not locking ENV: but just looking if it is there to avoid popping up requesters when doing the Get/SetEnv funcs.
|
13 April 2015, 01:33 | #14 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 728
|
Just disable requesters as Thomas said and re-enable them after you do your thing.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Storm Across Europe: does the ST conversion exists? | lilalurl | HOL data problems | 0 | 25 December 2012 20:15 |
Not even sure it exists but.... | rave | request.Modules | 0 | 07 January 2010 01:50 |
Kid Chaos AGA - exists ? | haynor666 | request.Old Rare Games | 3 | 03 August 2003 11:35 |
Which of this exists? | Drake1009 | request.Old Rare Games | 39 | 17 October 2001 23:48 |
|
|