Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: seeking fix for “File is too large for destination file system” erro


06 Dec 2011   #1

Windows 7
 
 
seeking fix for “File is too large for destination file system” erro

I have a program I wrote in Visual Basic that copies a file from one directory into another directory at a prescribed interval. The Visual Basic programs uses the ShellFileCopy API function
ShellFileCopy Visual Basic 6 API Function
FreeVBCode code snippet: Copy Files Using the Shell API


99% of the time, the program works fine.
However occasionally, I get a Windows error that pop's up that says
"File is too large for the destination file system"
This is extremely baffling as the size of the file that is being copied is under 1MB.

Does anyone have any idea to what would be triggering this error in Windows 7?
Thanks

My System SpecsSystem Spec
.

06 Dec 2011   #2

Windows 7 32 bit
 
 

Why are you using ShellFileCopy()? I'm asking because I used it in some programs but it was a long time ago. For your purpose can't you just use FileCopy()?

If I remember, I used Shell copy because it provided a progress dialog. If the files are that small that won't come into play. Or is the small file just because you are testing?

Edit:

Ok, I think I may see the problem. The wrapper function uses Strings as source and destination. If you read the MSDN entry for SHFILEOPSTRUCT the source and destination strings must have a double null terminator. If not, the function will just keep reading memory getting the source or destination name until it finds a double zero.

You need to make a string compatible with LPCTSTR type that has a double zero a the end.
My System SpecsSystem Spec
06 Dec 2011   #3

Windows 7
 
 

Miles, from what I recall, I had issues with Filecopy that I couldn't resolve.
I just changed my code to use Filecopy again and for now it seems to be working, so I may stick with it.

Regarding your second bit of advice on using ShellFilecopy,

"You need to make a string compatible with LPCTSTR type that has a double zero a the end."

If this is truly the problem, why am I getting this error only occasionally?
And how would a string mismatch trigger a "file to large" error

Thanks again
My System SpecsSystem Spec
.


06 Dec 2011   #4

Windows 7 Professional x86
 
 

My initial reaction to seeing your first post was you must be using FAT32 instead of NTFS, but then of course reading further saw the file size you were talking about, so that doesn't become a factor... I realise this doesn't help you, but may some one else having a “File is too large for destination file system” error
My System SpecsSystem Spec
06 Dec 2011   #5

Windows 7 32 bit
 
 

Quote   Quote: Originally Posted by techman41973 View Post
Miles, from what I recall, I had issues with Filecopy that I couldn't resolve.
I just changed my code to use Filecopy again and for now it seems to be working, so I may stick with it.

Regarding your second bit of advice on using ShellFilecopy,

"You need to make a string compatible with LPCTSTR type that has a double zero a the end."

If this is truly the problem, why am I getting this error only occasionally?
And how would a string mismatch trigger a "file to large" error

Thanks again
The error may really mean the file path is too long. You are calling the ANSI version of the function. Meaning max path is like 260 characters. The erratic behavior is right in line with this type of error. If there happens to be a double zero in memory after the file path before it exceeds 260 characters you may not get the error. Have you checked the output file names for funky characters hanging on the end?

I haven't done that much VB but there must be a method to fill a buffer with zeroes. Then copy a string into it and use the address so that it's guaranteed to have at least 2 zeroes at the end of the string.

When there's a warning like that on the API docs, that's almost always the problem. I don't think VB strings by default have 2 zeroes at the end.
My System SpecsSystem Spec
06 Dec 2011   #6

Windows 7 32 bit
 
 

SHFILEOPSTRUCT structure

See the entries for pFrom and pTo
My System SpecsSystem Spec
Reply

 seeking fix for “File is too large for destination file system” erro




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 06:41 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33