Cannot copy files due to long filenames

Discussion in 'Windows, Linux & Others on the Mac' started by hajime, Apr 22, 2016.

  1. hajime macrumors 68030

    Joined:
    Jul 23, 2007
    #1
    Hello, when I tried to copy files from one drive to another by drag and drop, Windows sometime gave a message saying that the files could not be put in the destination folder due to long filenames. However, I cannot tell which files they are and their locations. The opitions I had was to cancel the copying or skip copying those files. I could be copying files from linux or Windows to the Windows 7 64-bit partiion on my MBP 2010. What can I do to copy all the files even they have long file names?
     
  2. Shirasaki macrumors 603

    Shirasaki

    Joined:
    May 16, 2015
    #2
    Unless you use a filesystem which could support long file names, the only choice is to dig into each file, shorten the file name and try copying them again.
     
  3. ActionableMango macrumors 604

    ActionableMango

    Joined:
    Sep 21, 2010
    #3
    The file system supports incredibly long names. I don't remember the limit, but it's in the tens of thousands of characters. However, Explorer (the GUI you are using when doing a drag and drop) only supports 256 I think.

    So don't use the GUI. Copy files by command line.

    If you're not comfortable copying at the command line, ZIP the entire file and folder structure first. All of the complex folder structures and filename lengths will be "hidden" by being contained in the ZIP file. Then copy the ZIP file over, then unzip it.
     
  4. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #4
    I often have two issues in moving files from one drive to another via drag and drop. 1. The file names are too long. It seems that in addition to my files (perhaps created in unix/linux), there are some strange files in my HD. For instance, something like abc123429bfjdkjfdsjfs3328989328jflsjfd. Perhaps Windows created those files? 2. In the middle of, copying, I got can't copy due to permission error.

    For long filenames, somebody suggested compressing the files before copying. Does that mean just compress the entire drive and drag and drop the compressed .zip file to another drive?
     
  5. ActionableMango macrumors 604

    ActionableMango

    Joined:
    Sep 21, 2010
    #5
    Weird filenames like you describe are typically autogenerated temporarily files like caches, databases, etc. Or it could be corruption or even malware.

    But none of this is really making any sense. What exactly are you trying to do?

    If you are trying to move/copy personal files, such as documents, pictures, videos, etc., they they should have normal names and should copy easily.

    If you are trying to move/copy installed software, this isn't going to work, especially between two different operating systems. You should reinstall the software.

    And temporarily files like caches and whatnot are not meant to be moved either.
     
  6. hajime, Apr 28, 2016
    Last edited: Apr 28, 2016

    hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #6
    I took out internal drives of old PC, plugged them to my Mac under Windows 7. Created a desktop folder, say "From old drives". Then, created a folder for each old drive (e.g. FromOldPC1, FromOldPC2, etc.) Open each old drive icon, drag and dropped "everything" to either my Mac or another larger capacity drive connected to the Mac.
    --- Post Merged, Apr 28, 2016 ---
    A typical old drive contains: WINDOWS, My Downloads, Program Files, Documents and Settings. So, do you mean there is no point to copy the WINDOWS and Program Files folders? What about the "All Users" folder in the Documents and Settings folder?

    I just tried to use WinRAR to compress My Documents folder. I got a list of specified path cannot be found errors. Don't know what that means. Those files were made when I was using UNIX systems many years ago.
     
  7. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #7
    WinRAR does not work. Got lots of error when I tried to decompress the file. These are related to files stored in subfolders of about 10 levels down. Any other way to copy my old HD without getting those long filenames and cannot find specific path errors?
     
  8. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #8
    Have you checked the source computer's file system for errors?
     
  9. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #10
    Thanks for the suggestion. How?
    --- Post Merged, Apr 29, 2016 ---
    Thanks. What do you mean?
     
  10. rigormortis macrumors 68000

    rigormortis

    Joined:
    Jun 11, 2009
    #11
    disk utility, repair disk
    --- Post Merged, Apr 29, 2016 ---
    exFAT is a new file system that supports long file names and apple and windows can both read and write to it.

    try erasing the target disk and select exFAT, and see if that allows you to copy the files you are having troubles with
     
  11. ActionableMango macrumors 604

    ActionableMango

    Joined:
    Sep 21, 2010
    #12
    Yes, I can't think of any purpose for that, which is why I was asking why you were doing that.

    You do want to copy folders with any of your personal files that you would like to access, such as office documents, images, videos, downloads, Turbo Tax save files, anything you've created, etc. But the other stuff won't be useful in any way that I can think of, and isn't really meant to be copied wholesale this way onto a different computer and operating system.

    By trying to file copy the whole drive, you're definitely including useless temporary files like caches and whatnot. Those are the ones you mention with the very long gibberish file names.
     
  12. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #13
    Yes. You are right. Thanks.

    Copying files that are about 8 level deep (subfolder of subfolder of....) also have problems even I tried to compress the top level folder before copying. I don't know how to solve this problem yet.
     
  13. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #14
    By target disk, do you mean the disk where I want the old files to copy to? It is the Windows 7 partition on my MacBook Pro. I cannot erase it.
     
  14. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #15
    If you're copying FROM windows, then you need to run chkdsk, from linux, what ever it uses, for OS X, then Disk Utility.

    You mention all three operating systems, so I don't know where the files exist (linux/win/OSX)
    --- Post Merged, Apr 30, 2016 ---
    Target - the destination of where you want to copy the data too.

    Get yourself an inexpensive thumb drive, format it to exFAT and copy your files to that.
     
  15. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #16

    Formatting to exFAT seems to have solved the problem. I used to have over 1000 files with long filenames. Now it came down to about 10 which I could manually select whether or not to delete.

    Thanks all for the suggestions.
     
  16. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #17
    When I copied from another old drive. I got two strange issues:

    1. Again, long filename. Windows showed Support_main_flash, 03E6TREE as the files having the problem. The names are not long. Why it says that there is a possibility that the filenames are too long for the target folder, move to a location with a shorter path name? There are about 2000 of those files.

    2. Some of the property of the file will not be copied. What is that?

    I found it annoying that after waiting up from sleep or coming back from work, the copying process was halt waiting for me to tell Windows what to do.
    --- Post Merged, May 7, 2016 ---
     
  17. AidenShaw, May 8, 2016
    Last edited: May 8, 2016

    AidenShaw macrumors P6

    AidenShaw

    Joined:
    Feb 8, 2003
    Location:
    The Peninsula
    #18
    TreeSize is a graphical file manager that highlights directory trees with file paths longer than 255. https://jam-software.com/treesize_free/manual.php It also reports directory tree sizes, to make it super fast to find pig files.

    Your problem, if you're trying to copy the files on a windows system disk, is likely due to the fact that a windows system disk has infinitely long filenames under some of the directories.
    http://answers.microsoft.com/en-us/...robocopy/20f32f0c-4cb9-4125-923d-6a57e4d27232
     
  18. ActionableMango macrumors 604

    ActionableMango

    Joined:
    Sep 21, 2010
    #19
    I still don't understand what you are trying to do. Yes I know you're trying to copy files, but I mean, ultimately what are you trying to do?

    Simply trying to copy a whole OS drive into the existing folder structure of another OS via drag and drop file copying is just not something that has any purpose that I can think of. It's also fraught with problems, as you are experiencing, because it's not meant to be done.

    So can I ask what you are ultimately trying to do? Create a restorable backup? Have access to your documents? Because this isn't the right method for going about those tasks.
     
  19. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #20
    Over the past 20 years, I have about 20 hard drives. As I am moving country, I want to store all the stuffs to these drives to as few lightweight hard drives as possible. Note that some of these drives contains files from linux. Also, they contain backup files made by software like Norton Ghost, Patagon, etc.

    One thing I am confused is that I reformatted the new Lacie drive 2TB to exFAT. It has 1.8TB available. The source drive has used only 1.14TB according to the property. When I tried to copy a big folder which contains contents of several hard drive from the 1.14TB drive to the 1.8TB drive, Windows failed to copy and reported that I do not have enough space in the Lacie drive. How come?
     
  20. ActionableMango macrumors 604

    ActionableMango

    Joined:
    Sep 21, 2010
    #21
    Basically you're going about this all wrong. If you keep trying to use this method, you will continue to have problems. There is no way around it other than to change methods.

    This sort of stuff just isn't meant to be copied in this way. There is metadata such as file attributes and permissions that won't get copied correctly. Not to mention there are probably hidden files that aren't copying at all, and as you've discovered, folder structures and file names that are just too long.

    I can't suggest the exact way to copy the data, because I still don't know what you are trying to do with the archived data. But, here are some common examples:
    • You want to be able to access your documents, photos, etc., on a different computer -> file copying is fine, but copy only those folders with the relevant documents, not the whole drive.
    • You are making a complete system backup for a computer including all of its software so that later you can restore that complete system to that same computer -> make an image of the drive, or a whole system backup (don't use drag and drop file copy). There is software for doing a complete image backup.
    • You are making a complete system backup for a computer so that later you can restore that complete system to a different or newer computer -> that won't work for Windows and I don't think Linux either, but it will for OS X and Macs. So if this is for OS X, then do a complete image backup like bullet #2.
     
  21. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #22
    Have you looked at, or needed the data from any of those 20 hard drives? Seems like an excessive amount of hard drives and data.

    I'd go with @ActionableMango said in his first bullet. Go through your hard drives, determine what you want to save and that copy them to a single drive. I'm pretty sure you can easily cull the amount of information you need to copy.
     
  22. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #23
    Thanks all for the suggestions. I am pretty screwed up all these years.

    For the backup utility built in Windows 7, is it only for recovering on the "same" hardware. Am I right?
     
  23. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #24
    This link seems to indicate that you can. I've never used the windows backup method, so I can't confirm or deny the issue but MS appears to be saying you can
     
  24. hajime thread starter macrumors 68030

    Joined:
    Jul 23, 2007
    #25
    Thanks for the info. Sometimes it is better to get real user experience than what the manufacturer says.
     

Share This Page