Re: CopyFile is failing after some time ???



Well, how about limiting the length of the filename a user can enter? There is no way around the limitation of the filesystem, and you already came up with your own solution...


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Rahul P. Shukla wrote:
Hi…
In my Win mobile 5.0 based application, I have to fill the SD card (say it’s 1 GB card) with a large number of small files (say 50 KB size file). I am using CopyFile() API here in a loop.
I am changing the name of the file in each iteration (say file name is SmallFile.doc, in next CopyFile() execution file name will be SmallFile1.doc).
Now the problem occurring here that after an unexpected iteration, CopyFile() is throwing error as ERROR_DISK_FULL and coming out from the loop, though enough memory is still free. According to MSDN “To store the maximum number of files on PC Card storage devices, limit file names to eight uppercase characters and file extensions to three uppercase characters. Also, do not allow non-OEM characters in file names. File names that do not conform to these limits require more than one physical directory entry on a PC Card.”

I confirm this “file name size is creating problem” by giving the same file with 3 characters long, and application ran properly.

Now the main problem with me is, for my application user can give any file to fill with, so in some cases my application will not be able to fill it fully but will say that SD card filled completely.

Can anyone suggest me some way to complete it ….

.