comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » FILE_MOVE - FILE_COPY
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: FILE_MOVE - FILE_COPY [message #81900 is a reply to message #81801] Fri, 26 October 2012 06:21 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
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...

FILE_MOVE, fname[0], new_fname

Cheers,
Ben

* http://www.exelisvis.com/docs/FILE_MOVE.html (online - woooohooooo!)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: On-line Docs
Next Topic: a behemoth bubble sort

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:59:08 PDT 2025

Total time taken to generate the page: 0.00402 seconds