Welcome, Guest. Please login or register.

Author Topic: Coding: How do I do an assign from C?  (Read 1912 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Coding: How do I do an assign from C?
« on: January 08, 2012, 08:24:56 PM »
I would like to replicate the functionality of the CLI command assign from within an application. Does anybody know how to do this? I can't seem to find decent information about it anywhere. Is there an OS call or perhaps a dos.library call or something that would accomplish what I am trying to do?

I'd like to refrain from having to run the assign command as a process from within my app.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Coding: How do I do an assign from C?
« Reply #1 on: January 08, 2012, 08:54:48 PM »
You should try to avoid making assigns.

But if you cannot avoid it then the ez way is:
Code: [Select]
Execute("Assign Blah: Someplace:Whereever/",0,0)
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline krashan

  • Sr. Member
  • ****
  • Join Date: Jan 2003
  • Posts: 253
  • Country: pl
  • Thanked: 1 times
  • Gender: Male
  • Hardware designer and programmer
    • Show only replies by krashan
    • Personal homepage
Re: Coding: How do I do an assign from C?
« Reply #2 on: January 08, 2012, 09:29:21 PM »
Quote from: nyteschayde;674905
I would like to replicate the functionality of the CLI command assign from within an application. Does anybody know how to do this?

The dos.library has four related functions:
  • AssignAdd()
  • AssignLate()
  • AssignLock()
  • AssignPath()

Take a look into autodocs for details.

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #3 on: January 08, 2012, 09:53:25 PM »
Quote from: Krashan;674916
The dos.library has four related functions:
  • AssignAdd()
  • AssignLate()
  • AssignLock()
  • AssignPath()

Take a look into autodocs for details.


Awesome! You rule! Thanks
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #4 on: January 09, 2012, 05:00:04 AM »
I've just spent the last four hours trying to drum up information on these functions in relation to the dos.library and came up with nothing. Nothing in the dev CD version of the RKRMs. Nothing in my Abacus reference books. Nothing in the SAS/C dev docs. Nothing in the Addison Wesley RKRM print version I own.

If these functions exist, can you show me the reference you're using? Maybe take a snapshot with your smart phone or point me at a web page or anything? Perhaps a code snippet...

Quote from: Krashan;674916
The dos.library has four related functions:
  • AssignAdd()
  • AssignLate()
  • AssignLock()
  • AssignPath()

Take a look into autodocs for details.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: Coding: How do I do an assign from C?
« Reply #5 on: January 09, 2012, 05:15:37 AM »
Check the Autodocs: http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_3._guide/node0138.html

The RKRM is a programmers reference for general AOS coding, while the Autodocs describe the functions in the standard libraries (and more).
« Last Edit: January 09, 2012, 05:18:20 AM by Thorham »
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #6 on: January 09, 2012, 05:16:19 AM »
I've finally found the information in the AROS dev documents. See here:
http://aros.sourceforge.net/documentation/developers/autodocs/dos.php#assignpath
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #7 on: January 09, 2012, 05:17:47 AM »
Thanks. Good to know where it exists on the ADCD. God, I wish I had a decent grep executable on my miggy. Would help a lot. That and faster disk access. :)

Quote from: Thorham;674964
Check the Autodocs: http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_3._guide/node0138.html

The RKRM is a programmers reference for general AOS coding, while the Autodocs describe the system calls of the standard libraries.
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: Coding: How do I do an assign from C?
« Reply #8 on: January 09, 2012, 05:35:55 AM »
Quote from: nyteschayde;674966
Good to know where it exists on the ADCD.
If you have your Amiga and peecee (or another Amiga :)) set up side by side, you may want to view the docs on the peecee side (the link I provided is from elowar's AOS coding doc site which has a nice search function). I have it set up that way, and it's quite comfortable to use, because you don't have to do everything on the same monitor.
 

Offline nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show only replies by nyteschayde
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #9 on: January 09, 2012, 10:19:23 AM »
So far so good. I now have a one line command that performs all the system assigns to a path you define:

i.e. SysDisk DH0:OS/3.9 will perform the equivalent of

Code: [Select]
Assign Sys: DH0:OS/3.9 Path
Assign S: Sys:S Defer
Assign L: Sys:L Defer
Assign C: Sys:C Defer
Assign Devs: Sys:Devs Defer
Assign Libs: Sys:Libs Defer
Assign Fonts: Sys:Fonts Defer


Optionally it will also do things like HELP, LOCALE, and add CLASSES to Libs:, etc... if you supply the WB or WORKBENCH parameter to the command.

I have a little bit more debugging and source cleanup to perform and then I'll post it on aminet. If anybody has an interest or feature request please let me know.
« Last Edit: January 09, 2012, 10:21:56 AM by nyteschayde »
Senior MTS Software Engineer with PayPal
Amigas: A1200T 060/603e PPC • A1200T 060 • A4000D 040 • A3000 (x2) • A2000 Vamp/V2 • A1200 (x4) • A1000 (x3) • A600 Vamp/V1 • A500