From: Kevin on
I have seen this before but just don't have time to look into it. Actually there is not much that I can do since MOVEFILE is a built-in function.

I use MOVEFILE to rename file but it seems to me that it takes some time if the file is large. This should not happen.

Am I missing something?
From: Rune Allnor on
On 30 Nov, 23:46, "Kevin" <kh...(a)fake.com> wrote:
> I have seen this before but just don't have time to look into it. Actually there is not much that I can do since MOVEFILE is a built-in function.
>
> I use MOVEFILE to rename file but it seems to me that it takes some time if the file is large. This should not happen.
>
> Am I missing something?

Yes. The speed of disk operations depend on the
operating system. Some OSes allow you to rename
a file by updating the name property of some
look-up table in the file system, while other
OSes do not. Instead, they require the file to
actually be moved, in order to create a new entry
in the table and delete the old one.

If you happen to work with an OS that does not
allow users to manipulate the name properties,
you need to take the slow path.

Rune
From: Kevin on
Really!!! I am quite surprised any today OS would do that. I am using Windows Vista. I would think that even Windows would not even do that.

Or this is more related to Java. Does MOVEFILE eventually call some JAVA functions to do the actual work and to make this portable for all OS that Matlab supports?

Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <12e8aec7-ae45-40ce-b207-41ecaa47a5c2(a)r5g2000yqb.googlegroups.com>...
> On 30 Nov, 23:46, "Kevin" <kh...(a)fake.com> wrote:
> > I have seen this before but just don't have time to look into it. Actually there is not much that I can do since MOVEFILE is a built-in function.
> >
> > I use MOVEFILE to rename file but it seems to me that it takes some time if the file is large. This should not happen.
> >
> > Am I missing something?
>
> Yes. The speed of disk operations depend on the
> operating system. Some OSes allow you to rename
> a file by updating the name property of some
> look-up table in the file system, while other
> OSes do not. Instead, they require the file to
> actually be moved, in order to create a new entry
> in the table and delete the old one.
>
> If you happen to work with an OS that does not
> allow users to manipulate the name properties,
> you need to take the slow path.
>
> Rune
From: Steven Lord on

"Kevin" <khung(a)fake.com> wrote in message
news:hf1hv8$2dn$1(a)fred.mathworks.com...
>I have seen this before but just don't have time to look into it. Actually
>there is not much that I can do since MOVEFILE is a built-in function.
>
> I use MOVEFILE to rename file but it seems to me that it takes some time
> if the file is large. This should not happen.

Why not? If you've got a lot of bits to move, why shouldn't it take a while
to move them?


Are you using MOVEFILE with the source and destination file both on the same
local disk, or is one or both of the files on a network location?

Do you have a (potentially overzealous) virus scanner that needs to scan the
file before or as it's moving?

Is the disk to which you're moving the file heavily fragmented, so the OS
needs to search around a bit for places to put the pieces of the file?

Is some other process accessing the disk at the same time, thus causing
contention for who gets to read/write at a given time?

etc.


> Am I missing something?

Yes. There are lots of reasons why MOVEFILE could take some time to move a
file. Now that being said, if it's taking an EXTREMELY long time (say
minutes for a few meg file) then you should contact whomever is in charge of
maintenance for the system on which you're running to make sure that the
machine is operating correctly, and if they give it a thumbs-up contact
MathWorks Technical Support.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Kevin on
My scenario is very simple. I am just renaming a file in a directory in my local hard-drive, i.e. both source and destination files are in the same directory in my local hard-drive.

But you have raised a good point about the virus scanner. I use AVG and I would not know what AVG does.

"Steven Lord" <slord(a)mathworks.com> wrote in message <hf3ar4$p21$1(a)fred.mathworks.com>...
>
> "Kevin" <khung(a)fake.com> wrote in message
> news:hf1hv8$2dn$1(a)fred.mathworks.com...
> >I have seen this before but just don't have time to look into it. Actually
> >there is not much that I can do since MOVEFILE is a built-in function.
> >
> > I use MOVEFILE to rename file but it seems to me that it takes some time
> > if the file is large. This should not happen.
>
> Why not? If you've got a lot of bits to move, why shouldn't it take a while
> to move them?
>
>
> Are you using MOVEFILE with the source and destination file both on the same
> local disk, or is one or both of the files on a network location?
>
> Do you have a (potentially overzealous) virus scanner that needs to scan the
> file before or as it's moving?
>
> Is the disk to which you're moving the file heavily fragmented, so the OS
> needs to search around a bit for places to put the pieces of the file?
>
> Is some other process accessing the disk at the same time, thus causing
> contention for who gets to read/write at a given time?
>
> etc.
>
>
> > Am I missing something?
>
> Yes. There are lots of reasons why MOVEFILE could take some time to move a
> file. Now that being said, if it's taking an EXTREMELY long time (say
> minutes for a few meg file) then you should contact whomever is in charge of
> maintenance for the system on which you're running to make sure that the
> machine is operating correctly, and if they give it a thumbs-up contact
> MathWorks Technical Support.
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>