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

Home » Public Forums » archive » testing if two strings point to the same file
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: testing if two strings point to the same file [message #94265 is a reply to message #94264] Wed, 15 March 2017 15:56 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, March 15, 2017 at 11:43:13 PM UTC+1, Edward Hyer wrote:
> Hello IDL Wizards,
>
> IDL> file1='/tmp/qq/qq.dat'
> IDL> file2='/tmp//qq//qq.dat'
> IDL> file_copy,file1,file2
> % FILE_COPY: Source file must be different from target file.
>
> This situation will only arise if someone has done something dumb, or at least inconsistent. Let he/she who is without sin cast the first stone.
>
> Is there a good way to test if FILE1 and FILE2 are actually the same file?
>
> --Edward H.

I would try this (it works on windows):

f1_info = file_info(file1)
f2_info = file_info(file2)
if f1_info.name ne f1_info.name then file_copy,file1,file2 $
else print, 'no need to *overselfcopy*'

If you like to keep things short(er):
if (file_info(file1)).name ne (file_info(file2)).name then file_copy,file1,file2

cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: JPEG2000 with Floating point data possible?
Next Topic: install instructions for python bridge in 8.5.1 ?

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

Current Time: Wed Oct 08 15:58:00 PDT 2025

Total time taken to generate the page: 0.00237 seconds