Submit a Story  :  IRAF Links  :  Past Polls  :  Calendar  :  Advanced Search  
     iraf.net
FAQ
 Forum FAQForum FAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

imcopy/copy protect bug

 
Post new topic   Reply to topic    iraf.net Forum Index -> Applications
View previous topic :: View next topic  
Author Message
Jason Quinn
IRAF Guru


Joined: 07 Apr 2006
Posts: 151

PostPosted: Mon Oct 24, 2011 2:07 pm    Post subject: imcopy/copy protect bug Reply with quote

I noticed that doing an "imcopy" or a "copy" on protected image does not copy the protection even though the help file for "protect" says, "File protection is preserved when a file is copied or renamed". At least at some point in the past, copying the protection was the expected behavior. The imrename command does preserve the protection.

Cheers,
Jason

STEPS to produce:
protect somefile.fits
imcopy somefile.fits newfile.fits
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Mon Oct 24, 2011 9:05 pm    Post subject: Reply with quote

There are actually two problems here: The IRAF kernel didn't properly implement protection in the case of a file copy (and hasn't going as far back as v2.Cool, the second is that protection for images is done in the image kernel and the FITS kernel doesn't do this except in the case of file overwrites.

I've fixed the kernel bug so that when copying files the protection is preserved as intended (for FITS files using COPY instead of IMCOPY will do this as well). However, adding protection to the FITS kernel is a little trickier and since this isn't critical I've decided to put it off to the new version of the FITS kernel being developed. IMRENAME uses a different method to rename the files which is why it works.
Back to top
View user's profile Send private message
Jason Quinn
IRAF Guru


Joined: 07 Apr 2006
Posts: 151

PostPosted: Mon Oct 24, 2011 9:40 pm    Post subject: Reply with quote

fitz wrote:
There are actually two problems here: The IRAF kernel didn't properly implement protection in the case of a file copy (and hasn't going as far back as v2.Cool, the second is that protection for images is done in the image kernel and the FITS kernel doesn't do this except in the case of file overwrites.

I've fixed the kernel bug so that when copying files the protection is preserved as intended (for FITS files using COPY instead of IMCOPY will do this as well). However, adding protection to the FITS kernel is a little trickier and since this isn't critical I've decided to put it off to the new version of the FITS kernel being developed. IMRENAME uses a different method to rename the files which is why it works.


If this has been the behavior for so long, then life is apparently okay without it. It raises the question if protection should be preserved under a copy. An alternative solution is to simply decide that protection is not preserved. This has the added advantage of keeping past behavior. Perhaps just changing the help file for protect would be an easier solution. Is there a rational or design criteria why protection should be preserved under a copy?

Jason

Jason
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Mon Oct 24, 2011 9:47 pm    Post subject: Reply with quote

The rationale is probably as ancient as "that was the behavior under VMS on which the idea was based". In any case, protection for copy was implemented in the kernel, just incorrectly. Fixing this is probably harmless since it only affects those files explicitly covered by PROTECT. The only other place file protection is still used is for .imh files, but that's handled by the image kernel.

Your reasoning, though, is why I decided it wasn't critical to fix the image protection for this next release.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> Applications All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2009 phpBB Group
 Copyright © 2005-2011 iraf.net
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.11 seconds