Windows Explorer or "My Computer" shortens very long filenames whencopying

Discussion in 'Computer Information' started by jameshanley39@yahoo.co.uk, May 22, 2008.

  1. Guest

    windows explorer, or "my computer" does have an issue of shortening
    long filenames.. It may be filenames where the path including the
    filename, is long. That may have something to do with it.

    If you create a file (right click, new file). Or rename a file. Make
    the filename(name+ext) as long as you can..
    It can behave a bit oddly, losing the icon.. associated with it.
    Even when it is a bit shorter than that, so still the icon is there.

    If you create for example
    c:\aa\ReallyLongFileNameBlahBlahBlah.htm

    Make ReallyLongFileNameBlahBlahBlah.htm <-- 253 characters long is
    about as long as it will go.

    c:\aa\ccc\ReallyLongFileNameBlahBlahBlah.htm <-- 249 characters long
    is as long as it can go

    Be suspicious of some 256 related limit, like 255 or 256. Indeed, 256
    is the limit. It turns out it is 256.

    So you can see.. Excluding c:\ there is a max of 256 characters. I
    suppose for some reason the number of letters in a filename is related
    to 8 bits.

    If you highlight the filename, and do COPY-PASTE
    You get an error
    "
    Cannot Copy ReallyLongFileNameBlahBlahBlah.htm : Access is denied.
    Make sure the disk is not full or write-protected and that the file is
    not currently in use. "

    Now..
    If you copy the folder containing the long filename,
    Then it will copy, but it will shorten
    to something like REALLY~1.HTM

    funny how windows renames the file the same way DOS does when it can't
    handle filenames > 8 FILENAME.EXT is as big as DOS can handle, so that
    is where that convention came from (from DOS).

    This is very relevant to when copying websites , particularly copying
    them into a backup. 'cos
    a)Internet Explorer when it saves webpages, then by default, it gives
    them VERY LONG names. It doesn't use the filename. it uses something
    like the contents of the HTML TITLE tag. Which is often very long.
    b)a backup, mine at least, can have alot of nested subdirectories
    anyway, so a path can be quite long. And if a backup is on the
    desktop, then it is already padded to c:\documents and settings\user
    \desktop
    So to alleviate the problem slightly, it's better to have a shortcut
    on the desktop to c:\backup (like a directory for files you wish to
    backup. Like All your data).

    It is very problematic if you have saved webpages..

    You could make a list of your long ones and go through manually
    shortening names of files and directories. And then the find/replace
    references in the HTML itself to point to pictures in the new shorter
    directory.

    in future, don't let IE give it a long name. So type your own name.

    Opera gives it a short name (though sometimes I get an error that it
    cannot save a page.. so I use IE)

    Apparently Total Commander does not have this problem. It preserves
    the very long filenames.

    So you may have to use Total Commander to copy your backup. Instead of
    Windows Explorer.

    I noticed the problem when I copied my backup and compared the sizes
    before and after I noticed some difference, which I didn't get round
    to figuring out.. But I did a check with FSYNC - which does a
    directory comparison, and it showed various filenames had been
    shortened.

    What I think I will do. Is until I have fixed the filenames, I will
    use Free Commander - if it works.. Or maybe Total Commander (though
    apparently Total Commander is not free).

    the point about total commander came off an experts-exchange post!
    maybe googling an error message I mentioned above.

    Note-
    a)To see the length of a filename, e.g. if testing things.. You can
    use textpad. Paste it in. It shows the length in the status bar
    b)Testing long filenames did on one of my machines, crash windows..
    And I would suggest always and especially with laptops.. to have a
    crash freeze windows, not restart. So you can see an error. With oen
    of my laptops(panasonic toughbook), the error in event viewer--windows-
    restart actually shuts it off and it doesn't go on for a while! which
    is strange. Only servers - typically they are not laptops - i.e.
    computers running servers.. may want the restart option.
     
    , May 22, 2008
    #1
    1. Advertising

  2. Guest

    Re: Windows Explorer or "My Computer" shortens very long filenameswhen copying

    On 22 May, 21:21, ""
    <> wrote:
    <snip>

    incase anybody doesn't realise.. There is no question here..

    but if anybody has any intelligent comments, they are welcome.
     
    , May 22, 2008
    #2
    1. Advertising

  3. Re: Windows Explorer or "My Computer" shortens very long filenames when copying

    <> wrote in message
    news:...
    > On 22 May, 21:21, ""
    > <> wrote:
    > <snip>
    >
    > incase anybody doesn't realise.. There is no question here..
    >
    > but if anybody has any intelligent comments, they are welcome.



    I've never in my life seen a practical application for a path name of 255
    characters.
     
    Jeff Strickland, May 23, 2008
    #3
  4. Guest

    Re: Windows Explorer or "My Computer" shortens very long filenameswhen copying

    On 23 May, 00:48, "Jeff Strickland" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    > > On 22 May, 21:21, ""
    > > <> wrote:
    > > <snip>

    >
    > > incase anybody doesn't realise.. There is no question here..

    >
    > > but if anybody has any intelligent comments, they are welcome.

    >
    > I've never in my life seen a practical application for a path name of 255
    > characters.


    I wouldn't call it a practical application, as if it is suggested.

    But I gave the example of unfortunate behaviour of internet explorer.


    Well..here is an example..

    And this directory may have many more subdirectories, by the way!

    Here is a bogyman.. I amended the file/directory names a bit. But the
    length is there.

    C:\Documents and Settings\All Users\Documents\thebackups\formozy
    \smalltxtdoc\Topics\Bulldozing Articles\Bulldozing books

    Now if you get to another 100, you are at 214, so getting closer to
    your limit..

    Here is the form of the biggest bogyman I found
    (I did change the words slightly, but the concept is there)

    C:\Documents and Settings\All Users\Documents\thebackups\formozy
    \smalltxtdoc\Topics\Computer Articles\computer bookss\someamazpages
    \Amazon_com Books The Great Book The Complete Guide to Great Books And
    Nano Technology - read reviews_files\yourstore-off-sliced._ZCYOUR,
    0,2,100,100,verdenab,7,90,90,80_.jpg

    That was around a 281 character path. (including the c:\)

    That was just from saving a webpage with pictures, in internet
    explorer, using the default name. Which affects the .html file's name
    and the directory's name. And it happened to have a picture with a
    huge filename.


    Here is a different long one .

    C:\Documents and Settings\All Users\Documents\backups\formozy\medium
    \websites\bunch of alright bulldozing websites\Bulldozing_com-
    Bulldozer runs over man as he runs away from his fat wife outside the
    town court last week.html

    That one was around 220.
    So close enough, that if a picture was saved there e.g. with a
    filename that wasn't short, it would send it up past 256 .

    Internet Explorer saves webpages with those long names. It gets them
    from the <TITLE> tags.

    Look at this site for example
    http://www.securiteam.com/windowsntfocus/3X5Q2SAPPK.html
    It has a long title tag. So if you do file..SaveAs in IE, the default
    fielname is -long-.. If that had pictures, and that was nested in
    directories itself, it would be a bogeyman (to windows's built in
    copy, at least).
     
    , May 23, 2008
    #4
  5. Guest

    Re: Windows Explorer or "My Computer" shortens very long filenameswhen copying

    On 22 May, 21:21, "" <snip>
    > c:\aa\ccc\ReallyLongFileNameBlahBlahBlah.htm <-- 249 characters long
    > is as long as it can go


    typo, I meant 259

    >
    > Be suspicious of some 256 related limit, like 255 or 256. Indeed, 256
    > is the limit. It turns out it is 256.
    >
    > So you can see.. Excluding c:\  there is a max of 256 characters.   I
    > suppose for some reason the number of letters in a filename is related
    > to 8 bits.
    >


    I actually found 2 limits..

    One I mentioned.. 256 character path including filename. excluding
    the c:\

    Another, is a limit to the path excluding filename.
    245 character limit. Excluding the c:\, and going up to the ending
    \
    .That is 11 less than 256, so it allows for filename.ext


    Total Commander doesn't actually get around this problem..

    It cuts filenames if for example copying them into a path makes the
    filename-path too long.

    Windows is a bit funny in the way it deals with it..
    If you copy a long filename into the directory it is in, then it gives
    that error I mentioned only because it is trying to append the words
    "Copy Of" to the beginning. The filename may be OK in length.

    It is possible to trick windows into copying a filename too big, into
    a directory, and then the file doesn't open.. I think putting the
    filename in a small directory and copying the directory , can do that.
    Though another time I did something similar, it cut it using tilda. So
    windows is a bit tricky to predict. And when you do trick it,the
    file doesn't open, and cannot be renamed.

    So it's good that total commander, it seems, doesn't transgress those
    limits since they are windows limits, due to a windows issue.

    So I suppose a manual rename is one option..
    Or letting "Total Commander" cut them is another option.
    Or letting windows deal with it but if it doesn't cut it then maybe
    you won't be able to open or rename the file..


    <snip>
     
    , May 23, 2008
    #5
  6. Hp Guest

    Jeff Strickland wrote:

    > > incase anybody doesn't realise.. There is no question here..


    > > but if anybody has any intelligent comments, they are welcome.


    > I've never in my life seen a practical application for a path name of 255
    > characters.


    AMEN, extra long path names just seem plain silly to me,
    Why would there ever be a need for sloppy directory structures?
    Opps Silly Me, this is windows and its relationship with any
    mannor of user.

    Nice Tidy File structures makes things so much easier

    Now haveing stumbled onto the soapbox, A lot of programs do
    allow redefining the locations where they store their working
    directories, It Might prove benificial to locate the process
    and select a smarter file path structure for the working
    directories. This is something I do with any install that
    allows it
     
    Hp, May 24, 2008
    #6
  7. Guest

    Re: Windows Explorer or "My Computer" shortens very long filenameswhen copying

    On 24 May, 05:08, Hp <> wrote:
    > Jeff Strickland wrote:
    > > > incase anybody doesn't realise.. There is no question here..
    > > > but if anybody has any intelligent comments, they are welcome.

    > > I've never in my life seen a practical application for a path name of 255
    > > characters.

    >
    > AMEN,  extra long path names just seem plain silly to me,
    > Why would there ever be a need for sloppy directory structures?
    > Opps Silly Me, this is windows and its relationship with any
    > mannor of user.  
    >
    > Nice Tidy File structures makes things so much easier
    >
    > Now haveing stumbled onto the soapbox,  A lot of programs do
    > allow redefining the locations where they store their working
    > directories, It Might prove benificial to locate the process
    > and select a smarter file path structure for the working
    > directories.  This is something I do with any install that
    > allows it


    not applicable here..

    for example, a case where somebody is writing many txt files or even
    doc files, on a variety of topics , suppose they are a high school
    student,
    they may have a directory for maths, one for english, one for french,
    e.t.c.

    You can't just point Ms Word or Notepad to 1 directory that works for
    all. It could be subdirectories of that.

    But the problem was never about pointing software to these
    directories.

    It was of extra long paths.. The paths of my design, are very long,
    with many subdirectories, but nowhere near -that- long. Not long
    enough to cause the problem I described.

    The ones that are -that- long, are so, because I was using IE to save
    webpages.
    And if they were already sitting in c:\docu...\user\desktop\backup
    as oppose to \backup
     
    , May 25, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dadiOH
    Replies:
    1
    Views:
    1,955
    anthonyberet
    Jul 21, 2003
  2. 7
    Replies:
    6
    Views:
    885
    Thomas Kenyon
    Jun 22, 2006
  3. Big Ron

    Global edit of filenames in Windows explorer

    Big Ron, Jun 27, 2007, in forum: Computer Support
    Replies:
    4
    Views:
    3,597
    Plato
    Jun 28, 2007
  4. Richard
    Replies:
    13
    Views:
    1,071
    Dave Taylor
    Nov 15, 2004
  5. Skybuck Flying
    Replies:
    6
    Views:
    628
    Charlie Russel - MVP
    May 23, 2008
Loading...

Share This Page