This project is read-only.

File.Copy does not return after large file is copied.

May 20, 2011 at 2:37 PM
Edited May 20, 2011 at 2:38 PM

Here is a part of code:

vss.Setup(Path.GetPathRoot(source_file));
string snap_path = vss.GetSnapshotPath(source_file);
Alphaleonis.Win32.Filesystem.File.Copy(snap_path, backup_path); //backup path is a local path in C disk.

I also tried copying the same file localy, from D:\ to C:\ disk - same issue.

The code seems to run just fine except the fact that File.Copy never returns and hangs there forever, even though File is already there.
The code stops on NativeMethods.CopyFileExW(existingFileName, destinationFileName, routine, new SafeGlobalMemoryBufferHandle(), ref cancel, copyMode) inside AlphaFS File.Copy method.

This seems to happen only with larger files. I can reproduce this with file that's few GB in size. Smaller files that are like 100-200 are copied just fine.

Suggestions? 

May 20, 2011 at 4:52 PM

Can you give me the full paths of source and destination?
Also can you try to copy that file using newer standalone version of Alphafs?

On May 20, 2011 8:37 AM, "MariusK" <notifications@codeplex.com> wrote:
> From: MariusK
>
> Here is a part of code:
>
> vss.Setup(Path.GetPathRoot(source_file));
> string snap_path = vss.GetSnapshotPath(source_file);
> Alphaleonis.Win32.Filesystem.File.Copy(snap_path, backup_path); //backup path is a local path in C disk.
>
>
> The code seems to run just fine except the fact that File.Copy never returns and hangs there forever, even though File is already there.
> The code stops on NativeMethods.CopyFileExW(existingFileName, destinationFileName, routine, new SafeGlobalMemoryBufferHandle(), ref cancel, copyMode) inside AlphaFS File.Copy method.
>
> This seems to happen only with larger files. I can reproduce this with file that's few GB in size. Smaller files that are like 100-200 are copied just fine.
>
> Suggestions?
>
>
May 22, 2011 at 6:15 PM

Hello Marius,
Were you able to resolve the copy issue?

On May 20, 2011 10:51 AM, "Alexandr Normuradov" <normalex@gmail.com> wrote:
> Can you give me the full paths of source and destination?
> Also can you try to copy that file using newer standalone version of
> Alphafs?
> On May 20, 2011 8:37 AM, "MariusK" <notifications@codeplex.com> wrote:
>> From: MariusK
>>
>> Here is a part of code:
>>
>> vss.Setup(Path.GetPathRoot(source_file));
>> string snap_path = vss.GetSnapshotPath(source_file);
>> Alphaleonis.Win32.Filesystem.File.Copy(snap_path, backup_path); //backup
> path is a local path in C disk.
>>
>>
>> The code seems to run just fine except the fact that File.Copy never
> returns and hangs there forever, even though File is already there.
>> The code stops on NativeMethods.CopyFileExW(existingFileName,
> destinationFileName, routine, new SafeGlobalMemoryBufferHandle(), ref
> cancel, copyMode) inside AlphaFS File.Copy method.
>>
>> This seems to happen only with larger files. I can reproduce this with
> file that's few GB in size. Smaller files that are like 100-200 are copied
> just fine.
>>
>> Suggestions?
>>
>>
May 23, 2011 at 9:06 AM

Yes I was able to resolve it, it was rather my own mistake. The progress reporting code was not functioning well and it seemed all dead. Found the issue right away with a fresh head after the weekend :) AlphaFS works just fine. Sorry for inconveniences :)