Welcome, Guest. Please login or register.

Author Topic: Coding: How do I do an assign from C?  (Read 1926 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 all replies
    • 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 nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #1 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 all replies
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #2 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 nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #3 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 all replies
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #4 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 nyteschaydeTopic starter

  • VIP / Donor - Lifetime Member
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 643
    • Show all replies
    • http://www.nyteshade.com
Re: Coding: How do I do an assign from C?
« Reply #5 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