Hi all,
I'm experiencing a strange behavior of IDL when using FILE_MOVE and FILE_COPY and I'm not able to understand what is going on (probably because it's Friday:)).
I would like to rename a file.
for example:
fname=test_0.txt
new_fname= test_1.txt
Considering what is written in the IDL help it should be enough to do something like this:
"FILE_MOVE, fname, new_fname"
but when I try to do this I got the following error:
"FILE_MOVE: Destination must be a directory. File: test_1.txt"
I get the same error even if I try to move and rename the file to a new directory where I have write permissions.
FILE_MOVE, fname, output_path+new_fname
I have already used in this way this routine but I don't know why I'm facing this problem now.
The same is with FILE_COPY.
Does anybody know any suggestions/workarounds for this?
On Friday, October 26, 2012 5:16:29 AM UTC-4, titan wrote:
> Hi all,
> I'm experiencing a strange behavior of IDL when using FILE_MOVE and FILE_COPY and I'm not able to understand what is going on (probably because it's Friday:)).
> I would like to rename a file.
> for example:
> fname=test_0.txt
> new_fname= test_1.txt
> Considering what is written in the IDL help it should be enough to do something like this:
> "FILE_MOVE, fname, new_fname"
> but when I try to do this I got the following error:
> "FILE_MOVE: Destination must be a directory. File: test_1.txt"
> I get the same error even if I try to move and rename the file to a new directory where I have write permissions.
> FILE_MOVE, fname, output_path+new_fname
> I have already used in this way this routine but I don't know why I'm facing this problem now.
> The same is with FILE_COPY.
Hi,
The documentation* for FILE_MOVE says the destination must be a directory if the source points to more than one file.
"If more than one file is to be moved to a given destination, that destination must exist and be a directory."
Are you sure-sure-sure that 'fname' is a scalar? You might try...
Online and woefully out of date for some of the libraries. :-)
I wonder if there is a plan in place to update the documentation
on a regular basis. Anyone know?
Cheers,
David
-- David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/ Sepore ma de ni thue. ("Perhaps thos speakest truth.")
On Friday, October 26, 2012 3:21:45 PM UTC+2, ben.bighair wrote:
> On Friday, October 26, 2012 5:16:29 AM UTC-4, titan wrote:
> > Hi all,
> > I'm experiencing a strange behavior of IDL when using FILE_MOVE and FILE_COPY and I'm not able to understand what is going on (probably because it's Friday:)).
> > I would like to rename a file.
> > for example:
> > fname=test_0.txt
> > new_fname= test_1.txt
> > Considering what is written in the IDL help it should be enough to do something like this:
> > "FILE_MOVE, fname, new_fname"
> > but when I try to do this I got the following error:
> > "FILE_MOVE: Destination must be a directory. File: test_1.txt"
> > I get the same error even if I try to move and rename the file to a new directory where I have write permissions.
> > FILE_MOVE, fname, output_path+new_fname
> > I have already used in this way this routine but I don't know why I'm facing this problem now.
> > The same is with FILE_COPY.
> Hi,
> The documentation* for FILE_MOVE says the destination must be a directory if the source points to more than one file.
> "If more than one file is to be moved to a given destination, that destination must exist and be a directory."
> Are you sure-sure-sure that 'fname' is a scalar? You might try...
titan writes: > I'm sure that it is a scalar because if I try printing the variable I get only one value.
Uh, that is not a good way to tell if it is a scalar. Try
using the HELP command. :-)
Cheers,
David
-- David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/ Sepore ma de ni thue. ("Perhaps thos speakest truth.")
> Online and woefully out of date for some of the libraries. :-)
> I wonder if there is a plan in place to update the documentation
> on a regular basis. Anyone know?
IDLdoc will be able to produce output compatible to what is required by the Doc Center soon, so hopefully some of the labor of updating these library docs (at least the ones with IDLdoc formatted comments) will be eased. I have been working with Exelis VIS to output the correct format and just have a few more details to finish up.
Mike Galloy writes:
> IDLdoc will be able to produce output compatible to what is required by > the Doc Center soon, so hopefully some of the labor of updating these > library docs (at least the ones with IDLdoc formatted comments) will be > eased. I have been working with Exelis VIS to output the correct format > and just have a few more details to finish up.
Oh, this is very good news. Presumably this will be in a machine-readable
format that will allow a deamon to sweep the documentation up on a regular
basis. This will be good for everyone!