Home
%3CLINGO-SUB%20id%3D%22lingo-sub-723596%22%20slang%3D%22en-US%22%3EThe%20Case%20of%20the%20Failed%20File%20Copy%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-723596%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TechNet%20on%20Oct%2001%2C%202007%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20The%20other%20day%20a%20friend%20of%20mine%20called%20me%20to%20tell%20me%20that%20he%20was%20having%20a%20problem%20copying%20pictures%20to%20a%20USB%20flash%20drive.%20He%E2%80%99d%20been%20able%20to%20copy%20over%20two%20hundred%20files%20when%20he%20got%20this%20error%20dialog%2C%20after%20which%20he%20couldn%E2%80%99t%20copy%20any%20more%20without%20getting%20the%20same%20message%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20%3CIMG%20height%3D%22405%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087391%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087391%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120988i5C395F93F7F56CFC%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20405px%22%20width%3D%22550%22%20%2F%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Unfortunately%2C%20the%20message%2C%20%E2%80%9CThe%20directory%20or%20file%20cannot%20be%20created%E2%80%9D%2C%20provides%20no%20clue%20as%20to%20the%20underlying%20cause%20and%20the%20dialog%20explains%20that%20the%20error%20is%20unexpected%20and%20does%20not%20suggest%20where%20you%20can%20find%20the%20%E2%80%9Cadditional%20help%E2%80%9D%20to%20which%20it%20refers.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20My%20friend%20was%20sophisticated%20enough%20to%20make%20sure%20the%20drive%20had%20plenty%20of%20free%20space%20and%20he%20ran%20Chkdsk%20to%20check%20for%20corruption%2C%20but%20the%20scan%20didn%E2%80%99t%20find%20any%20problem%20and%20the%20error%20persisted%20on%20subsequent%20attempts%20to%20copy%20more%20files%20to%20the%20drive.%20At%20a%20loss%2C%20he%20turned%20to%20me.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EI%20immediately%20asked%20him%20to%20capture%20a%20trace%20with%20%3C%2FFONT%3E%3CA%20href%3D%22http%3A%2F%2Fwww.microsoft.com%2Ftechnet%2Fsysinternals%2Fprocessesandthreads%2Fprocessmonitor.mspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3EProcess%20Monitor%20%3C%2FFONT%3E%3C%2FA%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%2C%20a%20real-time%20file%20system%20and%20registry%20monitoring%20tool%2C%20which%20would%20offer%20a%20look%20underneath%20the%20dialogs%20to%20reveal%20actual%20operating%20system%20errors%20returned%20by%20the%20file%20system.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20He%20sent%20me%20the%20resulting%20Process%20Monitor%20PML%20file%2C%20which%20I%20opened%20on%20my%20own%20system.%20After%20setting%20a%20filter%20for%20the%20volume%20in%20question%20to%20narrow%20the%20output%20to%20just%20the%20operations%20related%20to%20the%20file%20copy%2C%20I%20went%20to%20the%20end%20of%20the%20trace%20to%20look%20back%20for%20errors.%20I%20didn%E2%80%99t%20have%20to%20look%20far%2C%20because%20the%20last%20line%20appeared%20to%20be%20the%20operation%20with%20the%20error%20causing%20the%20dialog%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20height%3D%22295%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087396%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087396%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120989iA41E85A542B194CA%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20295px%22%20width%3D%22550%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20To%20save%20screen%20space%2C%20Process%20Monitor%20strips%20the%20%E2%80%9CSTATUS%E2%80%9D%20prefix%20from%20the%20errors%20it%20displays%2C%20so%20the%20actual%20operating%20system%20error%20is%20STATUS_CANNOT_MAKE.%20%3CSPAN%20style%3D%22mso-spacerun%3A%20yes%22%3E%20%3C%2FSPAN%3E%20I%E2%80%99d%20never%20seen%20or%20even%20heard%20of%20this%20error%20message.%20In%20fact%2C%20the%20version%20of%20Process%20Monitor%20at%20the%20time%20showed%20a%20raw%20error%20code%2C%200xc00002ea%2C%20instead%20of%20the%20error%E2%80%99s%20display%20name%2C%20and%20so%20I%20had%20to%20look%20in%20the%20Windows%20Device%20Driver%20Kit%E2%80%99s%20Ntstatus.h%20header%20file%20to%20find%20the%20display%20name%20and%20add%20it%20to%20the%20Process%20Monitor%20function%20that%20converts%20error%20codes%20to%20text.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20At%20that%20point%20I%20could%20have%20cheated%20and%20searched%20the%20Windows%20source%20code%20for%20the%20error%2C%20but%20I%20decided%20to%20see%20how%20someone%20without%20source%20access%20would%20troubleshoot%20the%20problem.%20A%20Web%20search%20took%20me%20to%20this%20old%20%3C%2FFONT%3E%3CA%20href%3D%22http%3A%2F%2Fwww.osronline.com%2FshowThread.cfm%3Flink%3D7605%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Calibri%22%20size%3D%223%22%3Ethread%20%3C%2FFONT%3E%3C%2FA%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3Ein%20a%20newsgroup%20for%20Windows%20file%20system%20developers%3A%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20height%3D%22243%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087406%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087406%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120990i901BF2657A35D98E%22%20style%3D%22WIDTH%3A%20550px%3B%20HEIGHT%3A%20243px%22%20width%3D%22550%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Sure%20enough%2C%20the%20volume%20was%20formatted%20with%20the%20FAT%20file%20system%20and%20the%20number%20of%20files%20on%20the%20drive%2C%20including%20those%20with%20long%20file%20names%2C%20could%20certainly%20have%20accounted%20for%20the%20use%20of%20all%20available%20512%20root-directory%20entries.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20had%20solved%20the%20mystery.%20I%20told%20my%20friend%20he%20had%20two%20options%3A%20he%20could%20create%20a%20subdirectory%20off%20the%20volume%E2%80%99s%20root%20and%20copy%20the%20remaining%20files%20into%20there%2C%20or%20he%20could%20reformat%20the%20volume%20with%20the%20FAT32%20file%20system%2C%20which%20removes%20the%20limitation%20on%20entries%20in%20the%20root%20directory.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20One%20question%20remained%2C%20however.%20Why%20was%20the%20volume%20formatted%20as%20FAT%20instead%20of%20FAT32%3F%20The%20answer%20lies%20with%20both%20the%20USB%20drive%20makers%20and%20Windows%20format%20dialog.%20I%E2%80%99m%20not%20sure%20what%20convention%20the%20makers%20follow%2C%20but%20my%20guess%20is%20that%20many%20format%20their%20drives%20with%20FAT%20simply%20because%20it%E2%80%99s%20the%20file%20system%20guaranteed%20to%20work%20on%20virtually%20any%20operating%20system%2C%20including%20those%20that%20don%E2%80%99t%20support%20FAT32%2C%20like%20DOS%206%20and%20Windows%2095.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20As%20for%20Windows%2C%20I%20would%20have%20expected%20it%20to%20always%20default%20to%20FAT32%2C%20but%20a%20quick%20look%20at%20the%20Format%20dialog%E2%80%99s%20pick%20for%20one%20of%20my%20USB%20drives%20showed%20I%20was%20wrong%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CIMG%20height%3D%22462%22%20mce_src%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087416%2Foriginal.aspx%22%20original-url%3D%22http%3A%2F%2Fblogs.technet.com%2Fphotos%2Fmarkrussinovich%2Fimages%2F2087416%2Foriginal.aspx%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120991i8088D6FCE1E7678D%22%20style%3D%22WIDTH%3A%20267px%3B%20HEIGHT%3A%20462px%22%20width%3D%22267%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CSPAN%20style%3D%22mso-no-proof%3A%20yes%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%20couldn%E2%80%99t%20find%20the%20guidelines%20used%20by%20the%20dialog%20anywhere%20on%20the%20Web%2C%20so%20I%20looked%20at%20the%20source%20and%20found%20that%20Windows%20defaults%20to%20FAT%20for%20non-CD-ROM%20removable%20volumes%20that%20are%20smaller%20than%204GB%20in%20size.%20%3C%2FFONT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%20class%3D%22MsoNormal%22%20style%3D%22MARGIN%3A%200in%200in%2010pt%22%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20I%E2%80%99d%20consider%20this%20case%20closed%2C%20but%20I%20have%20two%20loose%20ends%20to%20follow%20up%20on%3A%20see%20if%20I%20can%20get%20the%20error%20message%20fixed%20so%20that%20it%E2%80%99s%20more%20descriptive%2C%20and%20lobby%20to%20get%20the%20default%20format%20changed%20to%20FAT32.%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20size%3D%223%22%3E%20Wish%20me%20luck.%20%3C%2FFONT%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-723596%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TechNet%20on%20Oct%2001%2C%202007%20The%20other%20day%20a%20friend%20of%20mine%20called%20me%20to%20tell%20me%20that%20he%20was%20having%20a%20problem%20copying%20pictures%20to%20a%20USB%20flash%20drive.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-723596%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMark%20Russinovich%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft
First published on TechNet on Oct 01, 2007

The other day a friend of mine called me to tell me that he was having a problem copying pictures to a USB flash drive. He’d been able to copy over two hundred files when he got this error dialog, after which he couldn’t copy any more without getting the same message:



Unfortunately, the message, “The directory or file cannot be created”, provides no clue as to the underlying cause and the dialog explains that the error is unexpected and does not suggest where you can find the “additional help” to which it refers. My friend was sophisticated enough to make sure the drive had plenty of free space and he ran Chkdsk to check for corruption, but the scan didn’t find any problem and the error persisted on subsequent attempts to copy more files to the drive. At a loss, he turned to me.


I immediately asked him to capture a trace with Process Monitor , a real-time file system and registry monitoring tool, which would offer a look underneath the dialogs to reveal actual operating system errors returned by the file system. He sent me the resulting Process Monitor PML file, which I opened on my own system. After setting a filter for the volume in question to narrow the output to just the operations related to the file copy, I went to the end of the trace to look back for errors. I didn’t have to look far, because the last line appeared to be the operation with the error causing the dialog:




To save screen space, Process Monitor strips the “STATUS” prefix from the errors it displays, so the actual operating system error is STATUS_CANNOT_MAKE. I’d never seen or even heard of this error message. In fact, the version of Process Monitor at the time showed a raw error code, 0xc00002ea, instead of the error’s display name, and so I had to look in the Windows Device Driver Kit’s Ntstatus.h header file to find the display name and add it to the Process Monitor function that converts error codes to text.


At that point I could have cheated and searched the Windows source code for the error, but I decided to see how someone without source access would troubleshoot the problem. A Web search took me to this old thread in a newsgroup for Windows file system developers:




Sure enough, the volume was formatted with the FAT file system and the number of files on the drive, including those with long file names, could certainly have accounted for the use of all available 512 root-directory entries.


I had solved the mystery. I told my friend he had two options: he could create a subdirectory off the volume’s root and copy the remaining files into there, or he could reformat the volume with the FAT32 file system, which removes the limitation on entries in the root directory.


One question remained, however. Why was the volume formatted as FAT instead of FAT32? The answer lies with both the USB drive makers and Windows format dialog. I’m not sure what convention the makers follow, but my guess is that many format their drives with FAT simply because it’s the file system guaranteed to work on virtually any operating system, including those that don’t support FAT32, like DOS 6 and Windows 95.


As for Windows, I would have expected it to always default to FAT32, but a quick look at the Format dialog’s pick for one of my USB drives showed I was wrong:




I couldn’t find the guidelines used by the dialog anywhere on the Web, so I looked at the source and found that Windows defaults to FAT for non-CD-ROM removable volumes that are smaller than 4GB in size.


I’d consider this case closed, but I have two loose ends to follow up on: see if I can get the error message fixed so that it’s more descriptive, and lobby to get the default format changed to FAT32.

Wish me luck.