|
|
The version of vi for DOS uses the directory C:\TMP as scratch space. Rumor has it there's a way of specifyimng a different directory to use when activating the editor. Is this so? How might I get vi to use, say, Y:\TMP instead?
12 responses total.
Use 'set temp=y:\tmp' in autoexec.bat?
Which "version of vi for DOS" are you using? There are probably six or more (some free, some commercial) that you can run under DOS and all do things slightly differently when it comes to the use of temp directories, rc files, etc. Free vi or vi-like programs that come to mind (for DOS) are vim, vile, elvis, xvi, and stevie. There are undoubtedly others. In elvis, for example, the temp directory is set by the option 'directory' (so for example, :set directory=d:\temp). As larsn implies, programs may use program-specific DOS environment variables to set the directory or may look for a generic environment variable called TMP or TEMP and use that. If an environment variable is used, you'll have to edit your autoexec.bat and set the variable to the desired value (and reboot for the setting to take effect). One thing you can try while in your editor is ":set all" from command mode and see if by luck the temp directory is listed as an option. It may not be called 'directory', of course, but something else like 'tmp' or 'tmpdir' (I made those last two up). If it is an option, you can set it while the program is running as noted above or you can put that set command in your exrc file (or whatever your vi uses for initial settings) to have it automatically be used each time you start the editor. If your DOS vi has on-line help (or a readme file), that'd be another place to look.
No online help, or clue as to the version. It just opens the file when run. I'll try resetting %TEMP% and %TMP% to see what happens.
Still no sign of a version number after going through with a hexdump program. But it's copyrighted 1986. Does that help?
(By Morris Kern Systems Inc.)
Ok, MKS vi is one of the commercial vi programs (Oak Hill vi is another, albeit shareware). Unfortunately, I know very little about MKS vi. Since it is commercial software, why not give MKS a call? I suppose you could also go through the vi executable with a "strings" program and see if you see anything interesting about what it is expecting (like what options are available, what environment vars are used).
Found it. ":set directory=Y:/TMP", and my vi has it, apparently. Just have to test it out with C:\TMP absent to make sure.
Cool. Hope it works for you.
Well I tried 'vi +"set directory=Y:/" testfile' with C:\TMP temporarily renamed, and it still gave me a Temporary Directory error (or file error, whatever). Doing a 'set directory=Y:\NONEXISTENT' once vi was running (with C:\TMP restored) did not produce an error, though 'set all' did list the directory as changed. I'm not sure now whether this parameter is ignored. I'll have to try renaming the directory while vi is running. (The purpose of this exercise, BTW, is to prevent vi from writing certain kinds of information to the hard drive, and to make it use the ramdrive instead, where the information can be counted on to go away.)
While testing, it's easiest to issue the set commands from the ex commandline in vi. However, once you figure out what settings you like/need, remember you can put them in your exrc file so that they are issued automatically every time vi is run. MKS vi may not use exrc as its initialization file--which is why I suggested using strings to see what it expects; and your program may only look for it in a particular place like your home directory or the directory where the vi binary is located, as examples. I don't know what your program will do if the temp directory doesn't exist; it may fall back to c:\tmp or something like that instead of issuing an error (although you'd expect at least a warning). Setting up a strange program can be a big hassle, but it sounds like you are zeroing in on the right setting. Good luck.
(Or you could download vim from some friendly dos shareware mirror, and use the best vi clone on the face of the earth. :)
Vim is cool. You might want to try that. It's charityware so it's free, and you can configure it to your liking.
Response not possible - You must register and login before posting.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss