8.436 bytes

Service Hints & Tips

Document ID: MCGN-3G5QDH

Aptiva - How can I use a RAM Drive with the DOS "SET TEMP" variable?

Applicable to: United States

If you exit the task swapper of the DOS 5.0 Shell improperly, DOS will create many small, left over files. They have names like XXXDOSCM.BAT. The files usually contain between two to eight command lines. The files can be deleted without causing any harm to DOS operations.

There is an easy way to keep such files from being saved to your fixed disk and ways to increase the speed of running a program on diskette. They involve the use of a RAM drive. A RAM drive is a DOS feature that is typically established in the memory above 640KB on a computer (although it can occupy memory below 640KB). Creating a RAM drive is something like adding another, small disk drive to your system. Speed is the main reason most people choose to add another drive by creating a RAM drive. A RAM drive differs from a typical fixed drive in that it is much faster. Instead of having an access time of anywhere between 19 to 40 milliseconds (typical access times for a fixed disk or diskette drive), a RAM drive has an access time equal to the speed of the memory on the system (usually around 80 nanoseconds). Just to give you an idea of how much faster this is, a millisecond is 1/1000 of a second. A nanosecond is 1/1,000,000,000 of a second. So, 80ns is equal to .00008ms and you can see that the RAM drive is faster than a disk drive. Programs can be loaded into and run from a RAM disk, depending on how large the RAM drive is. If you have a PS/1 with 1MB of memory, for example, you might have a RAM drive set up to use 384KB as a RAM drive. If you have the 2MB memory card installed on your PS/1 (for a total of 2.5MB memory), you may want a RAM drive as large as 1.5MB. The latter drive would be large enough to load many programs into it, while the 384KB RAM drive may not. Although a RAM drive is fast, it is not permanent. Anything that is loaded into RAM is lost when the computer is turned off. For this reason, RAM drives are typically used for temporary applications or applications that load from disk or diskette and remain on the disk for future use. In DOS 4.01, a RAM drive could be created using VDISK. In DOS 5.0, 6.x or 7.0, RAMDRIVE creates a RAM drive. If you use DOS 4.01, see your PS/1 Users' Reference Manual for more information on VDISK. If you use DOS 5.0, 6.x or 7.0 see the DOS manual for information on RAMDRIVE.

There are two ways to keep temporary (.TMP) files from accumulating on your fixed disk. If you have a RAM drive set up on your PS/1, you can use the SET TEMP variable in the AUTOEXEC.BAT file to point DOS to your RAM disk for all temporary files that are created. The SET TEMP variable can be explained in this way:

Some programs create temporary files while they are running. The software program will check to see if there is a "TEMP" environment variable in memory and give direction as to where to store temporary files. If a TEMP variable is not found, the file will usually be stored in the current directory. DOS 5.0, 6.x, and 7.0 work in this way, as do many other programs (although some may look for an environment variable of a different name, such as TMP). You can specify as many TEMP variables as you need. These environment variables can be regarded as road signs, telling programs which way to go within DOS. By telling programs to put temporary files in the RAM drive (using SET TEMP= to point to the RAM drive), you accomplish many things:

1) If you are using DOS 5.0, 6.x, or 7.0 and exit the Task Swapper inappropriately, and the "junk" temporary files discussed above are created, you don't have to go back to look for and delete these files. By setting the TEMP variable to a RAM drive, as soon as you turn off your computer, the temporary files will be removed from the RAM drive. The same is true for other programs which create temporary files and place them in the TEMP environment.

2) Placing temporary files in a RAM disk will make the software run faster because every time the temporary file is needed (which can be very often), the system accesses the RAM drive as opposed to the fixed disk.

If you don't use a RAM drive, you may want to create a TEMP directory on your fixed disk and use the SET TEMP variable in the AUTOEXEC.BAT to point to this directory (for example, SET TEMP=C:\TEMP would be a line in the AUTOEXEC.BAT). By doing this, if any temporary files are left on your fixed drive by a program, they will be in the TEMP directory. This makes it easy for the user to find such files and delete them.

Using a RAM drive is suggested for running programs that frequently read or write to files as the RAM drive will help the program run faster. Because RAM drives are volatile, be careful what applications you run from a RAM drive. For example, if you were creating a spreadsheet on a RAM drive (to be later saved to a fixed disk or diskette), there would be the possibility of losing all the data if:

1) There was a power failure,

2) The program froze, forcing a warm reboot, or

3) You forgot to copy the file to disk before turning off the system.

Search Keywords

Hint Category

DOS/Windows 3.x, Utility Software

Date Created

14-04-97

Last Updated

22-02-99

Revision Date

22-02-2000

Brand

IBM Aptiva

Product Family

PS/1

Machine Type

2011, 2144, 2168, 2121, 2123, 2133, 2155

Model

2R5; 2R7; 2R8; M30; M35; M50; 2R6; 4R7; 4R8; M40; M54; M58; 3R0; 3R8; M60; M70; 1R2; 66P; 67P; 86P; OR8; 1R1; 1R3; 1R5; 22P; 24P; 25P; 27P; 29P; 63P; 67P; 82P; 83P; OR6; OR7; OR9; 1R0; 1R1; 26P; 62P; 2R0; P30; C01; C34; M01; NEA; T35; U35; A62; A82; A94; B82; C42; C92; G42; M82; S92; 081; 087; 131; 137; K37; N31; N81; 11E; 13T; 14C; 16E; 17A; 18A; 18T; 19C; 21C; 23C; 28A; 46M; 51D; D50; G11; G13; G43; G46; G46; G49; G49; G50; G53; M40; M40; M46; M46; P11; P13; P43; P50; P53; R04; R05; R06; R09; R38; R42; R43; R44; R84; R86; R87; RO3; S11; S13; S43; S45; S45; S47; S47; S48; S48; S50; S53; W11; W13; W42; W42; W43; W45; W45; W50; W53; 20E; 22T; 24C; 24M; 28V; 39E; 41T; 43C; 45V; 48E; 50T; 52C; 55V; 72E; 74T; 76C; 78C; 79C; 81A; 82E; 84T; 86C; 87C; CC1; D53; G14; G44; G52; G54; G72; G76; G78; G82; NM1; P14; P44; P57; P71; P74; P76; P78; P84; R14; R15; R16; R17; R18; R51; R52; R57; R58; R62; R63; R67; R71; R89; R93; R96; R97; S14; S44; S50; S54; S70; S75; S76; S78; S80; W14; W44; W48; W54; W67; W76; W77; W78; Z33; 28V; 31E; 33T; 37C; 38C; 51E; 54T; 56C; 57C; 88V; BB1; G57; G87; OR1; OR3; OR4; OR5; P89; R28; R29; R31; R74; R78; R82; R98; S55; S85; SR1; US1; W52; W82; 2R3; S15

TypeModel

21442R5

Retain Tip (if applicable)

Reverse Doclinks
and Admin Purposes