Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#25 inability to located files with more than 3 ext. characters

open
nobody
None
5
2004-12-19
2004-11-24
Anonymous
No

Has anyone found a way to recognize the difference
between file names with more than 3 extension
characters?
I have software which generates backup copies of files
and in trying to program the deletion of the extra files,
DOS does not recognize anything beyond the 3
extension characters.
A deletion command erases the latest good file even if
the specific file name is given.

Ex:
filename.ext
filename.ext,1
filename.ext,2

delete filename.ext,1 actually deletes filename.ext

Thanks,
Brant McClelland
bmcclelland@designsolutions.com
512-331-0030

Discussion

  • Mark Hessling
    Mark Hessling
    2004-12-19

    • labels: 335145 -->
    • assigned_to: rexx --> nobody
     
  • Mark Hessling
    Mark Hessling
    2004-12-19

    Logged In: YES
    user_id=86185

    I don't see why this is a Regina bug? DOS only recognises
    files with 8.3 file format, so there is nothing Regina can
    do to overcome this.
    I'd suggest you ask in a DOS related group.
    I'll change this to a Support Request item.

     
  • Logged In: YES
    user_id=371416

    I believe that you have mis-stated your situation. You are
    actually running under Windows, rather than DOS (otherwise
    you wouldn't be able to have file names like "filename.ext,1"
    at all). Correct?

    On the assumption that you are actually running under
    Windows, I'm guessing that you have run into a rather
    nasty "feature" of windows which is a consequence of the
    attempt to make Windows95 backward-compatible with older
    16-bit (DOS) applications.

    DOS uses so-called 8-dot-3 names which (1) are all
    uppercase, (2) have a name part of at least one and no more
    than 8 characters, and an optional extension of up to 3
    characters.

    In addition to storing each file under its long name
    (i.e. "mylongfilename.ext"), 32-bit Windows also creates an
    8.3 alias, such as "MYLONG~1.ext" for any filename which is
    not 8.3 to begin with. When they create this alias, they
    truncate the extension to its first 3 characters, truncate the
    name part to 6 characters (if it is longer than 6) add a "~" and
    sequence digit to the name part**, and fold the result to
    uppercase. You can see these aliases if you use the /X
    option of the DIR command.

    ** there are some more complicated rules which I don't
    understand, which come into play if there are too many
    similar names.

    Anyway, since these aliases all have the same 3-character
    extension, and since Windows searches the 8.3 aliases as
    well as the long names (because it doesn't know if the
    program making the request needs backward compatibility or
    not), any name with the same first 3 chars in its extension
    will match! In your example above,
    filename.ext
    filename.ext,1
    filename.ext,2
    will all display if you do DIR FILE*.EXT
    even though you may not intend for the .ext,1 or .ext.2 file to
    be included.

    And here's the danger: if you issue a DEL instead of a DIR,
    all three of these files will be erased!

    You may be able to make your backup program work in one
    of the following three manners:
    (1) don't use wildcards
    (2) place the backup level in the name part, rather than the
    extension (i.e. "filename,1.ext" rather than "filename.ext,1")
    (3) place the backups in their own directory
    (i.e. "1/filename.ext" rather than "filename.ext,1")

    Hope that helps. Good luck!