File.Move

P

Peter Morris

Hi all

I have some code which monitors a folder, when it sees a zip it does this

01: Extract a file from the zip
02: Moves the zip file to a history folder under a new name

To move the file I use File.Move

I have noticed that sometimes although the target file appears the original
file remains, so it is copied rather than moved. Can anyone think of what
might be causing this?


Thanks
 
S

Stanimir Stoyanov

Hi Pete,

It is possible that the original file ingerited the "Read Only" attribute
thus leaving the original in the same place. You can try resetting the file
attributes using the System.IO.File class before moving it.
 
P

Peter Morris

Nope, it seems as though File.Move wasn't the culprit. I was using
File.Move in my MoveFileProcessor, but in my UnzipFileProcessor I was
actually doing this

01: Copy the ZIP to a history folder with a new name
02: Unzip the contents
03: Delete the ZIP file

It must have just been failing at step 3, which leads me in the direction of
suspecting Resco ZIP of holding onto the file for longer than it should even
though I have called archive.Close();

Thanks for your help though guys, sorry to have lead you on a wild goose
chase (whatever that actually means).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top