English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 12 April 2015, 17:22   #1
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
Question 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
AGS is offline  
Old 12 April 2015, 18:04   #2
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
Well, your program is running, therefore the directory it is started from must exist ?!?
Cylon is offline  
Old 12 April 2015, 18:06   #3
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
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.
AGS is offline  
Old 12 April 2015, 18:13   #4
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
Ah, I just found the dos.library function GetProgramDir(). But it's buggy, says the doc.
AGS is offline  
Old 12 April 2015, 18:28   #5
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
btw: Where is the ENV: dir under OS 4+? I cant see it among the assigns anymore.
AGS is offline  
Old 12 April 2015, 19:02   #6
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
It's not a directory any more, it is a handler.
thomas is offline  
Old 12 April 2015, 19:08   #7
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
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.
AGS is offline  
Old 12 April 2015, 19:20   #8
Leffmann
 
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.
Leffmann is offline  
Old 12 April 2015, 19:22   #9
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
I am not using AsmOne/Pro myself. I just got a mail that soemone has this problem with my GUI.
AGS is offline  
Old 12 April 2015, 19:24   #10
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Originally Posted by AGS View Post
Thanks, and how can I check if ENV: handler existst w/o the Lock() function? I want no req showing up.

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.
thomas is offline  
Old 12 April 2015, 19:27   #11
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
Quote:
BTW, the same can happen on OS3, too, if the user has installed HappyEnv or similar.
Ok, so it's good to implement a check.
AGS is offline  
Old 12 April 2015, 21:10   #12
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
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.
thomas is offline  
Old 12 April 2015, 21:14   #13
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
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.
AGS is offline  
Old 13 April 2015, 01:33   #14
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Just disable requesters as Thomas said and re-enable them after you do your thing.
alkis is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:09.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12847 seconds with 13 queries