M
Mattbooty
If this is the wrong forum I apologize and please point me in the
right direction.
I have a program where users can drag files from the file system and
drop them onto a list view. When the file is dropped my program 1)
moves the file to a directory specified within the application, 2)
looks at the file and databases some parts of it, 3) renames the file
based on information pulled in part 2.
the problem I'm seeing is that when i call File.Move(src,dst) the file
never actually moves until all processing completes so when i try to
rename the file (using another file.move) i get an error that the file
is in use. If I step through the code, I can watch the file in the
source directory and it never moves until ALL processing completes.
The same thing happens with file.copy. With file.copy the file does
get copied to the new location but it is still marked as locked from
the copy operation (plus the file copy adds a lot of time to the whole
process).
Is there any way to force the move to complete immediately... and then
to pause my program until the move finishes? I tried doevents, i
tried sleep, but the move operation just waited with the rest of the
program.
I'm running in VB.NET 2008. Any help would be a lifesaver
right direction.
I have a program where users can drag files from the file system and
drop them onto a list view. When the file is dropped my program 1)
moves the file to a directory specified within the application, 2)
looks at the file and databases some parts of it, 3) renames the file
based on information pulled in part 2.
the problem I'm seeing is that when i call File.Move(src,dst) the file
never actually moves until all processing completes so when i try to
rename the file (using another file.move) i get an error that the file
is in use. If I step through the code, I can watch the file in the
source directory and it never moves until ALL processing completes.
The same thing happens with file.copy. With file.copy the file does
get copied to the new location but it is still marked as locked from
the copy operation (plus the file copy adds a lot of time to the whole
process).
Is there any way to force the move to complete immediately... and then
to pause my program until the move finishes? I tried doevents, i
tried sleep, but the move operation just waited with the rest of the
program.
I'm running in VB.NET 2008. Any help would be a lifesaver