File.Move Question

  • Thread starter Thread starter Matthew Morvant
  • Start date Start date
M

Matthew Morvant

I have am working with a text file and wish to move the file when I am done
working with it. I have the following defined:

InputFolder: "D:\dhc_work\indexed\"
OutputFolder: "D:\dhc_work\classified\"
FileName:
"pinkf065111-26092005632633405685338094~LWS1A_20050209_105314.pdf.txt"
InputFile: InputFolder + FileName
OutputFile: OutputFolder + FileName

System.IO.File.Move(InputFile,OutputFile)

Once that peice of code executes the files are moved to the desktop. It
works like expected on my development machine, but once it gets on the
server everything goes to the desktop. I use the same file structure and
names on my dev machine and I used a MessageBox to show the file paths on
the server and they display correctly. Does anyone have any ideas on this
one?

Matthew
 
I'd check things like permissions, does the folder exist, can i write to
it, can the user the program runs as write to it? in it?

if you've checked all that, I don't know what to suggest.

sorry i couldn't help more. I'm using File.Move to move .txt files
extracted from .pdf files (as it looks like you're doing) and I've never
come across that problem.

the only difference is that I'm moving the file to a directory, not to
another file:

using System.IO;
...
File.Move(txtFileName, outputDir);

it looks like you're doing something like this:
File.Move(InputFolder + FileName, OutputFolder + FileName);

if I were you, I'd try:
File.Move(InputFolder + Filename, OutputFolder);

jeremiah
 
I thought of that, but the documentation says that both input and output are
full file paths. I guess it wouldn't be the first time that documentation
was wrong, but I will look into that. Might be an update issue as well, I
need to make sure both machines are using the same version of the framework.

thanks
 
Back
Top