1. DOS & Long File Names

I'm using DOS 6.21 and I'm trying to figure out a way to get a Euphoria
     program to display the abbreviated file names that DOS will show for Windows 95+
     long file names and the corresponding actual Windows name.  I'd imagine this
     would involve directly reading some separate sector or something which is way,
     WAY above my understanding of how to do.  (Being able to create a long-named file
     for future transport to windows would also be a big plus.)  Any help on this
     would be GREATLY appreciated.

Semi-Related:
I have very limited hard drive space.  I want to scan for Windows programs.
      I have a program that will let me find *.exe files, BUT I don't know what the
     difference in the header between DOS executables and Windows Executables.  (I
     want to get rid of any Windows programs floating around on my computer.  There
     probably are some because I found one the other day.)  So anybody know what the
     difference is?  Thanks for all your help.
                            - Robert McDougal


Free web-based email, Forever, From anywhere!
http://www.mailexcite.com

new topic     » topic index » view message » categorize

2. Re: DOS & Long File Names

>     I want to scan for Windows programs.  I have a program that will let
>me find *.exe files, BUT I don't know what the difference in the header
between DOS executables and >Windows Executables.  (I want to get rid of any
Windows programs floating around on my computer.  There >probably are some
because I found one the other day.)  So anybody know what the difference is?
use debug <filename> from DOS;  -d  dumps the contents in Hex and Ascii
format. The first block of bytes displayed should tell you that it is a
MS-Windows program. use q to quit debugging mode.

NEW! HTTP://www.geocities.com/SiliconValley/Lab/7577
Michael J Raley's Modular Reality Journal
-----Original Message-----
From: Robert McDougal <thedoog at MAILEXCITE.COM>
To: EUPHORIA at cwisserver1.mcs.muohio.edu
<EUPHORIA at cwisserver1.mcs.muohio.edu>
Date: Sunday, July 26, 1998 4:18 PM
Subject: DOS & Long File Names

new topic     » goto parent     » topic index » view message » categorize

3. Re: DOS & Long File Names

At 16:14 26/07/98 -0700, you wrote:
>     I have very limited hard drive space.  I want to scan for Windows
>     programs.  I have a program that will let me find *.exe files, BUT I don't know
>     what the difference in the header between DOS executables and Windows
>     Executables.  (I want to get rid of any Windows programs floating around on my
>     computer.  There probably are some because I found one the other day.)  So
>     anybody know what the difference is?  Thanks for all your help.
>                            - Robert McDougal

here is a function that will check a file to determine if it is a windows
executable.

include file.e

constant signatures = { -- possible window file signatures
  "PE",-- window NT file
  "NE" -- window 3.x or later file
  }

-- this function return 1 if the file is a widowns executable (.DLL or .EXE)
-- return 0 if not a windows exec
-- return -1 if can't open it.
atom fh,ok
integer c,hdr
sequence FileId

  fh = open(FileName,"rb")
  if fh = -1 then return -1 end if
  FileId = getc(fh) & getc(fh)
  if compare(FileId,"MZ") != 0 then
    return 0  -- it's  not a DOS or windows executable
  end if

  ok = seek(fh,#18)
  c = getc(fh)+256*getc(fh)
  if c < #40 then
    close(fh)
    return 0  -- not a window file. (DOS executable)
  end if
  ok = seek(fh,#3C)
  hdr = getc(fh)+256*getc(fh) -- offset of new executable header
  ok = seek(fh,hdr)  -- window file header start here.
  FileId = getc(fh) & getc(fh)  -- new header signature
  close(fh)
  if find(FileId,signatures) then
    return 1   -- yes it is a windows executable file.
  else
    return 0  -- unkown file type.
  end if
------------------------------





Jacques Deschenes
Baie-Comeau, Quebec
Canada
desja at globetrotter.qc.ca

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu