Dear friends,
I am facing a major problem with File Copy operation in AMS. I have no problems when copying files of sizes less than 5GB. When the file sizes are above 5GB the File.Copy operation takes 10 times more time than normal file copy operation. This happens only when I show the File Copy status using in built status dialog or Progress Bar. With out these the file copying is fast enough. But I would like a way to show the status and also copy files faster.
I tried a different method to overcome this problem. What I did was to perform File Copy with out call back function and also no status dialog. While the file is being copied I wrote a small piece of code in on timer event to check the file size of the file being copied and calculate the percentage of file copied and display the status using Progress Bar.
But the problem here is When I do File.GetSize operation of the file being copied AMS returns 0. So to over come this problem I tried doing a file refresh using SHChangeNotify DLL call but the file is not getting refreshed. I used the below code.
DLL.CallFunction(_SystemFolder.."\\SHELL32.DLL", "SHChangeNotify", "134217728, SHCNE_ALLEVENTS, NULL, NULL", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
But what I realised is that while file is being copied if I open the explorer and go to the folder in to which the file is being copied and refresh manually, the progress bar starts updating. But I need to keep the explorer window open all the time.
Is there any way to solve this problem?
Please help me with your valuable suggestions.
Thanking you in advance.
Venkat
I am facing a major problem with File Copy operation in AMS. I have no problems when copying files of sizes less than 5GB. When the file sizes are above 5GB the File.Copy operation takes 10 times more time than normal file copy operation. This happens only when I show the File Copy status using in built status dialog or Progress Bar. With out these the file copying is fast enough. But I would like a way to show the status and also copy files faster.
I tried a different method to overcome this problem. What I did was to perform File Copy with out call back function and also no status dialog. While the file is being copied I wrote a small piece of code in on timer event to check the file size of the file being copied and calculate the percentage of file copied and display the status using Progress Bar.
But the problem here is When I do File.GetSize operation of the file being copied AMS returns 0. So to over come this problem I tried doing a file refresh using SHChangeNotify DLL call but the file is not getting refreshed. I used the below code.
DLL.CallFunction(_SystemFolder.."\\SHELL32.DLL", "SHChangeNotify", "134217728, SHCNE_ALLEVENTS, NULL, NULL", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
But what I realised is that while file is being copied if I open the explorer and go to the folder in to which the file is being copied and refresh manually, the progress bar starts updating. But I need to keep the explorer window open all the time.
Is there any way to solve this problem?
Please help me with your valuable suggestions.
Thanking you in advance.
Venkat
Comment