Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
99 user(s) are online (89 user(s) are browsing Forums)

Members: 0
Guests: 99

more...

Support us!

Headlines

 
  Register To Post  

Recognizing assignments
Just can't stay away
Just can't stay away


See User information
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 + Radeon HD 5450

Go to top
Re: Recognizing assignments
Just can't stay away
Just can't stay away


See User information
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, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: Recognizing assignments
Just can't stay away
Just can't stay away


See User information
@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 + Radeon HD 5450

Go to top
Re: Recognizing assignments
Just can't stay away
Just can't stay away


See User information
@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
Go to top
Re: Recognizing assignments
Just can't stay away
Just can't stay away


See User information
@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, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: Recognizing assignments
Just can't stay away
Just can't stay away


See User information
@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 + Radeon HD 5450

Go to top
Re: Recognizing assignments
Just can't stay away
Just can't stay away


See User information
@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 + Radeon HD 5450

Go to top
Re: Recognizing assignments
Just can't stay away
Just can't stay away


See User information
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, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project