473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

File.Move Question

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.p df.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
Nov 17 '05 #1
2 1799
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

Matthew Morvant wrote:
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.p df.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

Nov 17 '05 #2
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

"jeremiah johnson" <na*******@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Matthew Morvant wrote:
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.p df.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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: vince | last post by:
MSDN help says you can use a UNC path for any methods that accept a path, and I'm wondering if I can also substitute an IP address for the UNC....??? Example: Using System.IO.File.Move() ...
31
by: Arvind Varma Kalidindi | last post by:
Hi, I was asked this question in an interview recently. "How do you move to the 6th byte in a file?" ... My thinking would be to find the data types in the file, set a base pointer and advance it...
1
by: Danny | last post by:
Hello, I was hoping someone might be able to shed some light on this bizarre behaviour. I have observed some strange behaviour with System.IO.FIle.Move where it seems to be copying a file as...
1
by: Matthew Eno | last post by:
I have a problem where I'm developing some code that moves files from one place to another (on the same drive) with the destination file having a new name. What's happening is that the line of...
2
by: B-Dog | last post by:
Is there a way to make vb.net to overwrite the file when moving? Here is what I'm trying to do: If System.IO.File.Exists(dest) Then 'handle overwrite here If MessageBox.Show("Do you want...
8
by: Inspector | last post by:
I'm hoping I might be able to pick someone's brain out there. Our company is currently running an inhouse application in which data is being stored in SQL. Included in this data are thousands...
2
by: Denis Correard | last post by:
I'm writing an application that would move a file from 1 place to another and print it, but I'm having errors if the file is in use by another process when I'm trying to move it. Is there a way to...
1
by: Tim Failes | last post by:
This seems a trival question, but I cannot get it to work properly... Essentially my question is, how can I create a text file, and guarantee it is given the current date/time as the Creation Time?...
5
by: ericunfuk | last post by:
I'm wondering if the following is fesible. I copy a whole file into memory, then I traverse forwards and backwards in the part of the memory contains the file, to get the chunk of the file I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.