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

Home » Public Forums » archive » Re: Copying files in IDL
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: Copying files in IDL [message #31192 is a reply to message #31190] Wed, 19 June 2002 19:55 Go to previous messageGo to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Reimar Bauer wrote:
>
> Sean Raffuse wrote:
>>
>> Hello folks. I would like to make a copy of an hdf file, changing only to
>> filename and the content of one of datasets in the hdf. I have no problem
>> putting in the new content, but this overwrites the old file, which I need
>> to preserve. How do I copy and/or rename the file in IDL? I don't want to
>> have to rebuild the entire hdf file and it's dozens of attributes. Just a
>> near exact copy with a different name.
>>
>> Thanks in advance,
>>
>> Sean
>
> Dear Sean,
>
> what's with this primitive way.
>
> spawn,'cp file.hdf new_file.hdf'
>
> and then operations on then new file.
>
> regards

The disadvantage of this solution is that it's not portable.
If the filesize is not to large, you can do something like:

openr,1,'file.hdf'
fs=fstat(1)
b=bytarr(fs.size)
readu,1,b
close,1
openw,1,'new_file.hdf'
writeu,1,b
close,1


cheers,
marc
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 3-d viz
Next Topic: .idl data format

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

Current Time: Wed Oct 08 19:46:31 PDT 2025

Total time taken to generate the page: 0.00425 seconds