Re: Another Windows98 Bug...

From: Eric Stevens (ejstevenat_private)
Date: Sat Feb 13 1999 - 12:51:34 PST

  • Next message: Lincoln Stein: "Applets listening on Sockets in Java"

      I've researched this a bit.
      The real issue here seems to be that Windows (all versions including, but
    not limited to Win 95, 98, NT4.0 [sp3 & sp4]) apparently only accept file
    names up to 218 characters in length.  The maximum number of characters you
    can enter in the little rename file box is 214 bytes.  Any file name greater
    than 218 bytes including extension and dot is truncated with out attention
    paid to the extension in the truncation process.  Example: aaaa.....aaa.txt
    of length 219 would become aaaa......aaa.tx .  The Windows standard Save
    File dialog (Common Dialog control: comctl32.ocx) control alllows the entry
    of filenames up to apparently 259 bytes, which will promptly be truncated to
    that 217 byte limit.  This truncation is done by the comctl32.ocx control,
    not the program trying to save the file.  The program happily accepts the
    filename truncated by comctl32.ocx.  If this program attempts to append an
    extension on this filename, you may very well have a real issue.
       Character 160 has no bearing on this whatsoever.
       At 252  characters, applications receive errors when trying to save files
    (tested by an application I wrote myself for this purpose).
         code:
    1     For b = 1 To 300
    2       a = Left(Trim(Str(b + 4)) + String(b, "a"), b) + ".txt"
    3       Open "c:\test\" + a For Output As #1
    4       Close
    5     Next
      line 2 declares the filename to be the value of b plus 4 (for the ".txt"
    on the end) plus the appropriate number of "a" 's on the end.
    This piece of code does not truncate the file name in any way, just returns
    a file not found error.  All the files whose length are greater than 217
    crash on right click or pushing the delete button.  The only way apparently
    to get rid of these guys very easily is to just drag them to the recycle
    bin.
      Since all the lengths I've reported above don't jive with each other, I
    suppose the moral of this story is "When deciding how large to make your
    buffer, tell everyone who's working on developing your OS so they all make
    it the same."  If Microsoft had agreed amongst each other how long to make
    the file name, this wouldn't be an issue.
    
    -----Original Message-----
    From: Nick Lamb <njl98rat_private>
    To: BUGTRAQat_private <BUGTRAQat_private>
    Date: Saturday, February 13, 1999 3:04 PM
    Subject: Re: Another Windows98 Bug...
    
    
    >On Fri, 12 Feb 1999, Jensen Allan AJE wrote:
    >
    >> It seems to be an Explorer-only bug, as no other application I've tried
    went
    >> down.
    >
    >Every application that uses the Win95-style common file dialog will crash
    >if you try to right-click on the over-length filename.
    >
    >In addition, I tried the following apps and as well as confirming the
    >right-click problem I attempted to open the file...
    >
    >Word 7.0 seemed to ignore my attempt to open the file
    >PowerPoint 7.0 seemed to ignore my attempt to open the file
    >Excel 7.0 crashed with a standard crash dialog
    >Paint Shop Pro 4.12 exited immediately without any messages
    >Photoshop 4.0 politely said "File Not Found"
    >
    >The lab test machine claims to be NT 4.00.1381, which may or may not be
    >important for this bug nest.
    >
    >Nick.
    >
    



    This archive was generated by hypermail 2b30 : Fri Apr 13 2001 - 14:34:38 PDT