You are not logged in. Login Now
 0-12          
 
Author Message
drew
vi Mark Unseen   Jun 29 05:27 UTC 1998

    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.
larsn
response 1 of 12: Mark Unseen   Jun 29 19:45 UTC 1998

Use 'set temp=y:\tmp' in autoexec.bat?
kentn
response 2 of 12: Mark Unseen   Jun 29 20:25 UTC 1998

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.
drew
response 3 of 12: Mark Unseen   Jun 29 22:10 UTC 1998

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.
drew
response 4 of 12: Mark Unseen   Jun 29 22:22 UTC 1998

Still no sign of a version number after going through with a hexdump program.
But it's copyrighted 1986. Does that help?
drew
response 5 of 12: Mark Unseen   Jun 29 22:23 UTC 1998

(By Morris Kern Systems Inc.)
kentn
response 6 of 12: Mark Unseen   Jun 30 03:57 UTC 1998

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).
drew
response 7 of 12: Mark Unseen   Jul 3 15:13 UTC 1998

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.
kentn
response 8 of 12: Mark Unseen   Jul 3 16:45 UTC 1998

Cool.  Hope it works for you.
drew
response 9 of 12: Mark Unseen   Jul 4 17:03 UTC 1998

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.)
kentn
response 10 of 12: Mark Unseen   Jul 4 17:23 UTC 1998

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.
dang
response 11 of 12: Mark Unseen   Jul 16 18:23 UTC 1998

(Or you could download vim from some friendly dos shareware mirror, and
use the best vi clone on the face of the earth. :)
rlejeune
response 12 of 12: Mark Unseen   Apr 12 18:49 UTC 2002

Vim is cool. You might want to try that. It's charityware so it's free, and you
can configure it to your liking. 
 0-12          
Response Not Possible: You are Not Logged In
 

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss