From: Kevin on 1 Dec 2009 18:50 Hmm. I am missing something. After MOVEFILE is executed, the source file should not exist anymore. Right? Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <89dd7d3f-2020-461c-813e-1cf7e2ba6656(a)k19g2000yqc.googlegroups.com>... > On 2 Des, 00:36, Rune Allnor <all...(a)tele.ntnu.no> wrote: > > On 1 Des, 04:59, "Kevin" <kh...(a)fake.com> wrote: > > > > > 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. > > > > Run the script below with the file browser open. > > The script stores 32MBytes of data in the file > > test01.mat, and renames the file to test02.mat, > > test03.mat, etc., up to test21.mat. > > > > Under winXP and R2006a you can see that there are > > two files present at any time; the source file > > and destination file. In this configuration there > > is in fact a file copy taking place. > > > > Rune > > It's well after midnight - forgot the code...: > > A = randn(1000000,4); > save test01.mat A > > tic > for n=1:20 > sname = sprintf('test%02d.mat',n); > dname = sprintf('test%02d.mat',n+1); > movefile(sname,dname); > end > toc > delete(dname);
From: Rune Allnor on 1 Dec 2009 19:47 On 2 Des, 00:50, "Kevin" <kh...(a)fake.com> wrote: > Hmm. I am missing something. > > After MOVEFILE is executed, the source file should not exist anymore. Right? Don't top post! Both the source and destination files exist *while* the file is moved. Which is why one can confidently state that there is a copy taking place. Rune
From: Kevin on 1 Dec 2009 20:17 Just curious how you do that. How do you know that the source file and destination file exists while MOVEFILE is running? Do you have another Matlab or window apps running to do directory listing all the time? Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <cfeb78fd-d324-4f39-b3f4-72f3eae17ba8(a)o10g2000yqa.googlegroups.com>... > On 2 Des, 00:50, "Kevin" <kh...(a)fake.com> wrote: > > Hmm. I am missing something. > > > > After MOVEFILE is executed, the source file should not exist anymore. Right? > > Don't top post! > > Both the source and destination files exist *while* the > file is moved. Which is why one can confidently state > that there is a copy taking place. > > Rune
From: Chris on 14 Dec 2009 09:42
"Kevin" <khung(a)fake.com> wrote in message <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. > > Am I missing something? I suspect there is some dependence on the number of files in the directory you are moving files from. I'm trying to use matlab to move images that meet a certain criteria, & although none over 100kb in size, the movefile function takes over a minute per file. The dos('move ...') takes 10s (including loading and some arithmatic) per file, which is considerably quicker, but still slow! |