DOSLIB Release 2_c1
ADS DOS Library
Programmer's Reference


Agreement

DOSLIB Release 2_c1
Copyright (C) 1992-94, Robert McNeel & Associates
3670 Woodland Park Avenue North
Seattle, WA  98103
(206) 545-7000

Permission to use, copy, modify, and distribute this software for any purpose
and without fee is hereby granted, provided that the above copyright notice
appears in all copies and that both that copyright notice and this permission
notice appear in all supporting documentation.

Robert McNeel & Associates makes no warranty, including but not limited to
any implied warranties of merchantability or fitness for a particular purpose,
regarding the software and accompanying materials.  The software and
accompanying materials are provided solely on an "as-is" basis.

In no event shall Robert McNeel & Associates be liable to any special,
collateral, incidental, or consequential damages in connection with or
arising out of the use of the software or accompanying materials.

* DOSLIB is a trademark of Robert McNeel & Associates.
* AutoCAD, AutoLISP and ADS are registered trademarks of Autodesk, Inc.
* MS-DOS and Windows are registered trademarks of Microsoft Corporation.
* All other brands and product names are trademarks or registered trademarks
  of their respective holders.


Introduction

DOSLIB is an AutoCAD Development System (ADS) application that adds DOS
command line functionality to the AutoLISP programming language.  DOSLIB
gives your AutoLISP functions or commands greater DOS capabilities that
what is currently offered by the current suite of AutoLISP functions.

With DOSLIB you can:  change between drives and check free disk space; make,
change and remove directories; copy, delete, and rename files; search for
lost files or for multiple instances of a file; create and manipulate
Windows-style initialization (INI) files; and other miscellaneous DOS-type
operations.


Requirements

DOSLIB requires either AutoCAD Release 12 for DOS or AutoCAD Release 12
for Windows.


Files

DOSLIB.EXE - ADS DOS Library (Windows version)
DOSLIB.EXP - ADS DOS Library (DOS version)
DOSLIB.WRI - Manual in Windows Write format
DOSLIB.TXT - Manual in text format


History

DOSLIB Release 2_c1 (11/22/94)

* Fixes "General Protection Exception" errors with DOS version and
  (dos_setini) function.
* Changed "version" number to "release" number.

DOSLIB Version 2.0 (7/14/94)

* Added (dos_attrib), (dos_touch), (dos_getini), (dos_setini), (dos_beep),
  (dos_help) and (dos_win) functions to library.
* Changed name of Windows ADS filename to match that of the DOS filename.

DOSLIB Version 1.0 (11/28/93)
* Initial release of DOSLIB ADS DOS Library.


Functions


Drive Handling

(dos_drive [drive])
Returns or changes the current drive.

Examples:
Command: (dos_drive)
Command: (dos_label "c:")

(dos_drives)
Returns a list of drives.

Examples:
Command: (dos_drives)

(dos_diskfree [drive])
Returns the free disk space on a drive.

Examples:
Command: (dos_diskfree)
Command: (dos_diskfree "c:")


Path Handling

(dos_fullpath path)
Makes a full path name from a partial path name.

Example:
Command: (dos_fullpath "acad.exe")

(dos_makepath drive directory filename extenstion)
Makes a full path name from components.

Example:
Command: (dos_makepath "c:" "acad" "acad" "exe")

(dos_splitpath path)
Splits a full path name into components.

Example:
Command: (dos_splitpath "c:\\acad\\acad.exe")


Directory Handling

(dos_chdir path)
Changes the working directory.

Example:
Command: (dos_chdir "\\drawings")

(dos_mkdir path)
Makes a directory.

Example:
Command: (dos_mkdir "\\drawings")

(dos_rmdir path)
Removes a directory.

Example:
Command: (dos_rmdir "\\drawings")

(dos_pwdir [drive])
Returns the path to the working directory.

Examples:
Command: (dos_pwdir)
Command: (dos_pwdir "c:")

(dos_subdir [path])
Returns a list of subdirectories.

Examples:
Command: (dos_subdir)
Command: (dos_pwdir "c:\\acad")


File Handling

(dos_attrib filespec bit-code)
Changes file attributes. (0 = Normal, 1 = Read Only, 2 = Hidden,
4 = System and 8 = Archive)

Examples:
Command: (dos_attrib "c:\\acad\\acad.exe" 1)
Command: (dos_attrib "*.dwg" 3)

(dos_copy source destination)
Copies a file.

Examples:
Command: (dos_copy "acad.dwg" "c:\\drawings\\acad.dwg")

(dos_delete filespec)
Deletes one or more files.

Examples:
Command: (dos_delete "acad.bak")
Command: (dos_delete "*.bak")

(dos_dir [filespec])
Returns a list of files.

Examples:
Command: (dos_dir)
Command: (dos_dir "*.dwg")

(dos_file filename)
Returns detailed file information.

Example:
Command: (dos_file "acad.dwg")

(dos_find filename [drive])
Finds a file on a specified drive.

Examples:
Command: (dos_find "acad.dwg")
Command: (dos_find "acad.dwg" "c:")

(dos_rename filename1 filename2)
Renames a file or directory.

Example:
Command: (dos_rename "acad.dwg" "acadold.dwg")

(dos_search filename environment)
Searches for a file using an environment path.

Example:
Command: (dos_search "acad.exe" "path")

(dos_touch filespec)
Changes the file modification date and time.

Examples:
Command: (dos_touch "acad.dwg")
Command: (dos_touch "*.dwg")


Initialization File Handling

(dos_getini section entry filename)
Returns a entry from an INI file.

Examples:
Command: (dos_getini "network" "dirtycount" "acadnode.ini")

(dos_setini section entry value filename)
Creates or changes a entry in an INI file.

Examples:
Command: (dos_setini "network" "dirtycount" "0" "acadnode.ini")


Miscellaneous Functions

(dos_about)
Displays information about DOSLIB.

Example:
Command: (dos_about)

(dos_beep frequency duration)
Generates a sound using the PC speaker.

Example:
Command: (dos_beep 500 500)

(dos_date [date])
Returns or changes the system date.

Examples:
Command: (dos_date)
Command: (dos_date "1-1-1980")

(dos_help)
Displays a listing of DOSLIB functions.

Example:
Command: (dos_help)

(dos_time [time])
Returns or changes the system time.

Examples:
Command: (dos_time)
Command: (dos_time "10:00")

(dos_ver)
Returns the operating system version number.

Example:
Command: (dos_ver)

(dos_win)
Returns the currently running operating environment.  (T = Windows, nil = DOS)

Example:
Command: (dos_win)
