473,387 Members | 1,453 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,387 software developers and data experts.

File.Move not working as expected

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 opposed to actually moving it. The following is
a description of my setup:

Two separate machines (A and B) both running Windows Server 2003. Machines
reside on the same domain.

An application is running on machine A and it is responsible for managing
files on machine B. In particular it will (among other things) be moving a
file from one share (share1) on machine B to another share (share2) on
machine B.

Using an example, we have a file called bla.bla that is currently sitting in
location share1. The call in the application on machine A will attempt to
move bla.bla to location share2. e.g.

File.Move(share1/bla.bla, share2/bla.bla)

This call blocks until the operation is complete however upon return rather
then seeing that bla.bla has been moved, we actually see it now exists in
both locations (share1 *AND* share2). It SHOULD only now reside in share2.

The files in question can range in size from aprox. 10MB to say 300MB

Can anyone explain this wierdness? As far as I know, it should not be
happening.

Best regards,

Danny
Jul 21 '05 #1
1 1607
Maybe it has to do with shares in particular... A move operation may not be
supported by all client types, and therefore the only "common" way of moving
a file (over network shares) is by copying and deleting?? Just a guess...

"Danny" wrote:
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 opposed to actually moving it. The following is
a description of my setup:

Two separate machines (A and B) both running Windows Server 2003. Machines
reside on the same domain.

An application is running on machine A and it is responsible for managing
files on machine B. In particular it will (among other things) be moving a
file from one share (share1) on machine B to another share (share2) on
machine B.

Using an example, we have a file called bla.bla that is currently sitting in
location share1. The call in the application on machine A will attempt to
move bla.bla to location share2. e.g.

File.Move(share1/bla.bla, share2/bla.bla)

This call blocks until the operation is complete however upon return rather
then seeing that bla.bla has been moved, we actually see it now exists in
both locations (share1 *AND* share2). It SHOULD only now reside in share2.

The files in question can range in size from aprox. 10MB to say 300MB

Can anyone explain this wierdness? As far as I know, it should not be
happening.

Best regards,

Danny

Jul 21 '05 #2

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

Similar topics

18
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
1
by: alanrn | last post by:
Is it possible for OCA files to become corrupt? If so, how and what can one do to "repair" them? Or, perhaps, there are other nefarious forces at work here? :-( Here are the particulars of my...
9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
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...
2
by: Matthew Morvant | last post by:
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:...
1
by: Chris | last post by:
We had an application running on a server that had been working for months with no problem. Last night, without any known change to the server, it started to fail. We tried all kinds of...
6
by: lilcech | last post by:
How can i cobine my image with a html file so i only have one file. The image is used inside the html file so if i delete it or move it, then it wont show up in the html file. :)
12
by: mantrid | last post by:
Hello Can anyone point me in the right direction for the way to read a text file a line at a time and separate the fields on that line and use them as data in an INSERT to add a record to a mysql...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.