Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
9 user(s) are online (3 user(s) are browsing Forums)

Members: 0
Guests: 9

more...
Support us!
Recent OS4 Files
OS4Depot.net





Recognizing assignments
Quite a regular
Joined:
2008/1/6 17:56
From Pennsylvania, USA
Posts: 773
Is there a way (in C code) to find out if a user-input path contains an assignment on 68k (classic) Amiga? It looks like it will easy with newer OS4 AmigaDOS functions but I haven't found a way to do it in OS3.

_________________
Amiga X1000 with 2GB memory & OS 4.1FE

   Report Go to top

Re: Recognizing assignments
Quite a regular
Joined:
2006/11/24 18:52
From Gloucestershire, UK.
Posts: 859
I'd just check if the path exists and not worry whether it's a device, volume or assign. but if you want to do it the hard way Dopus5 must already build a list of assigns for the device list, can't you reuse some of that code? Might be quicker to check anything that ends with a colon is not a device or volume then assume it's an assign.

_________________
Amiga user since 1985
AOS4, Alinea, (can't say), (another I can't say), (and another) Betatester

Ps. I hate the new amigans website <shudder>
Pps. and it's getting worse <double shudder>
   Report Go to top

Re: Recognizing assignments
Quite a regular
Joined:
2008/1/6 17:56
From Pennsylvania, USA
Posts: 773
@Severin
Quote:
I'd just check if the path exists and not worry whether it's a device, volume or assign.
Normally, paths would be resolved to the volume name to account for removable media. However, it doesn't make good sense to set the Dopus5 paths to removable media. Relative paths based on the current directory must be resolved but I may just skip the resolving for paths containing device, volume or assign names as you suggest. That's easier to code and leaves the decision of whether to use a volume or device name up to the user.

It would still be nice to know how to determine if an OS3 path is assignment based for future reference.

_________________
Amiga X1000 with 2GB memory & OS 4.1FE

   Report Go to top

Re: Recognizing assignments
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1281
@xenic

Quote:

Is there a way (in C code) to find out if a user-input path contains an assignment on 68k (classic) Amiga?


This code should do just that:
BOOL ContainsAssign(CONST_STRPTR path) {
    
TEXT name[256];
    
int np;
    
struct DosList *dl NULL;

    
np SplitName(path':'name0sizeof(name));

    if (
np != -1) {
        
dl LockDosList(LDF_ASSIGNS|LDF_READ);
        
dl FindDosEntry(dlnameLDF_ASSIGNS|LDF_READ);
        
UnLockDosList(LDF_ASSIGNS|LDF_READ);
    }

    return 
dl TRUE FALSE;
}



Edited by salass00 on 2015/1/11 8:01:44
   Report Go to top

Re: Recognizing assignments
Quite a regular
Joined:
2006/11/24 18:52
From Gloucestershire, UK.
Posts: 859
@xenic

Quote:
Normally, paths would be resolved to the volume name to account for removable media. However, it doesn't make good sense to set the Dopus5 paths to removable media.


You'd be surprised at what I've seen done over the years using the assign PATH option to allow the same assign to be used on whatever removable media is in the drive at the time.

_________________
Amiga user since 1985
AOS4, Alinea, (can't say), (another I can't say), (and another) Betatester

Ps. I hate the new amigans website <shudder>
Pps. and it's getting worse <double shudder>
   Report Go to top

Re: Recognizing assignments
Quite a regular
Joined:
2008/1/6 17:56
From Pennsylvania, USA
Posts: 773
@salass00
Thanks. We decided to let the user decide what kind of path to use but your code will come in handy in other places.

_________________
Amiga X1000 with 2GB memory & OS 4.1FE

   Report Go to top

Re: Recognizing assignments
Quite a regular
Joined:
2008/1/6 17:56
From Pennsylvania, USA
Posts: 773
@Severin
Quote:
You'd be surprised at what I've seen done over the years using the assign PATH option to allow the same assign to be used on whatever removable media is in the drive at the time.

Not as surprised as you might think. I have dozens of programs I've HEX edited to put data where I want it, not on my write-protected System or Work partitions. That's why I have assignments like FROGDIR: and ENVARK:

_________________
Amiga X1000 with 2GB memory & OS 4.1FE

   Report Go to top

Re: Recognizing assignments
Quite a regular
Joined:
2006/11/24 18:52
From Gloucestershire, UK.
Posts: 859
Back in the late 90's I used to abuse the assign path command with zip disks, I used to take my A4000/060 into a mates shop 2 days a week and do DTP, scanning etc. for customers who were amazed at how fast I could scan a logo to knock up a letter head or poster using adpro and pagestream 2.2 (both running at once of course while playing mp3's in the background through my masplayer, really pissed of the PC owners )

Basically I had business, home and club zip disks, wallpapers, music, clipart, dopus5 desktop, fonts etc. all assigned with the path option. Stick a zip disk in and reboot and dopus5 came up with a custom desktop for what ever I was doing without all the clutter of having everything all the time.

Yes I've also hex edited loads of programs to change data placement also used to convert a lot of *cough* dodgy *cough* copies of german software to english...

_________________
Amiga user since 1985
AOS4, Alinea, (can't say), (another I can't say), (and another) Betatester

Ps. I hate the new amigans website <shudder>
Pps. and it's getting worse <double shudder>
   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2014 The XOOPS Project