DOS Python

William Tanksley wtanksle at ieng9.ucsd.edu
Tue Oct 12 23:35:40 EDT 1999


On Fri, Oct 08, 1999 at 10:36:57AM +0200, Hans Nowak wrote:
> On 7 Oct 99, at 13:00, William Tanksley wrote:
> > >> Great.  I'll do that right away, if I can find an .arj extractor.
> > >> Speaking of which, is there any particular reason why you used .zip for
> > >> the executable and .arj for the (required) libraries?

> > >That's more for hysterical raisins; I wrote a script which packs a 
> > >directory and all its subdirectories in an arj file; I did not manage 
> > >to do so for zip files (back then, that is :).
> > pkzip -ad ?  It's part of the zip command set.
> I suppose so; I never liked pkzip much, I preferred other (often more 
> obscure) archivers like rar, ace, and jar. :)

Well, that makes sense to me :).  I still prefer PC Geos to Windows.

> > But anyhow, this still isn't working for me, and I'm slamming up against
> > a nasty deadline.  The problem is that I have to run this under pure DOS,
> > and I _must_ call an external program.  When I do "import os" under wpy,
> > it tells me that there's no such module.
> > The PythonDX library has long file names, which aren't supported under DOS.

> If you unpack them with arj, the name should be sliced off to 8.3 
> format. Not the ugly tilde notation, mind you; exceptions.py will 
> become exceptio.py rather than except~1.py. You should be able to do 
> 'import exceptions' and it still finds them. (It should, anyway)

> Don't forget to set your PYTHONPATH variable correctly, of course, 
> and since this is DOS, setting the PYTHONCASEOK variable will help a 
> lot too. In fact, if you have a file called OS.PY in DOS (rather than 
> os.py), Python might not find it unless you do a SET PYTHONCASEOK=1. 
> The Python source is Unix-based and making it work correctly on a 
> case-insensitive, 8.3-filename based OS takes a few tricks. 

Ah, that's another thing I was about to ask.  Excellent.  Thank you again.

> > arj appears to have two options for truncating the long file names.  Which
> > of them should I use?

> Hmmz, I just do arj x archive.arj -y and it doesn't ask me any 
> questions... 

Odd.  It refused to do anything for me until I set the -hf2 option.  However,
once I did that (and answered 'yes' to the first obnoxious question), it
worked great.

Almost.  Okay, I just tried setting those environment variables, and it
seems to work, but it still prints a warning message -- "Built-in
exception class not found: EnvironmentError.  Library mismatch?"

I have to suspect that the library file you pointed me to and the one you
meant to point me two are different, especially since we report completely
different behaviors for ARJ.

At least it seems to work -- I've gotten my program mostly running.

> > >> Okay, this will clearly take some more work.  It seems that the arj
> > >> program doesn't support long file names, but the arj archive includes
> > >> them.  (How'd you manage that?)

> > >Oh it does, if you have the right version. Here's one:
> > >http://www.cuci.nl/~hnowak/stuff/Arj.exe
> > >I believe this link *is* on my site somewhere. :-)

> > Not that I could find.  You don't suppose that you could zip the archive up,
> > do you?

> I could use WinZip. ;-) 
 
Not too bad of an idea.  infoZip is also nice.  If you're actually going to
do this (not that you HAVE to, after all it's not like I'm paying you) might
you consider zipping the executable and the library together?

> > I'm in a world of hurt.  I hope someone can fix this!
 
> Aww... I'll see what I can do...
 
Thanks!  And thanks to some work with IDLE, I was able to develop most of
the functionality I needed (that is, the part that didn't require a DOS
environment to merely run).  Of course, now I'm addicted to IDLE.  Oh well.

This is a really great group.  Thanks, Hans.

> --Hans Nowak (ivnowa at hvision.nl)





More information about the Python-list mailing list