Welcome to iraf.net Friday, April 19 2024 @ 03:36 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Possible copy bug
   
Jason Quinn
 04/30/2006 05:05AM (Read 4575 times)  
+++++
Active Member

Status: offline


Registered: 04/07/2006
Posts: 175
I may have found a bug in IRAF's [i:d8167a55da]copy[/i:d8167a55da] command. I've noticed that [i:d8167a55da]copy[/i:d8167a55da] corrupts some gzipped files. For instance, try downloading and [i:d8167a55da]copy[/i:d8167a55da]'ing [b:d8167a55da]table.2.gz[/b:d8167a55da] fromhttp://vizier.cfa.harvard.edu/viz-bin/ftp-index?/ftp/cats/J/A%2bA/424/919/x70z02Notice the file size increases by 1 after a copy. The UNIX [i:d8167a55da]cp[/i:d8167a55da] command does not corrupt the file allowing [i:d8167a55da]gunzip[/i:d8167a55da] to run without a premature end of file error. Some of the other files from the URL such as [b:d8167a55da]table.10.gz[/b:d8167a55da] and [b:d8167a55da]table.16.gz[/b:d8167a55da] exhibit the same behavior. Ideas?Jason

 
Profile Email
 Quote
fitz
 04/30/2006 05:05AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
This is a side-effect of the size of an SPP character (two bytes) meaning that iraf file i/o can't write an odd number of bytes to a file. In most cases the extra NULL is harmless but this is one case where a host program doesn't like it (another being some tasks reading the GIF images produced by EXPORT, however there a "null extension" is actually in the gif spec but rarely implemented as legal). Changing the size of an spp char is a one-line change, but after 20 years there may be untold numbers of unintended consequences in other tasks. OTOH, we're in good shape to start using unicode chars in the system 8-) Simplest thing is to just use 'cp' for binary files, it's a default foreign task and is readily available.-MikeP.S. Note: This isn't a file corruption of any kind, it is just that there is an extra NULL byte on the file in the event the input file was an odd size.

 
Profile Email
 Quote
Jason Quinn
 04/30/2006 05:05AM  
+++++
Active Member

Status: offline


Registered: 04/07/2006
Posts: 175
[quote:98a543410c="fitz"]This is a side-effect of the size of an SPP character (two bytes) meaning that iraf file i/o can't write an odd number of bytes to a file. [/quote:98a543410c] Thank you, Mike. Wow! I consider myself pretty good at IRAF and I can't believe that I never noticed this or that it never caused me a problem before. Hmmm... I better doublecheck some of my scripts.[quote:98a543410c="fitz"]we're in good shape to start using unicode chars in the system[/quote:98a543410c] Until that happens, perhaps the help file for [i:98a543410c]copy[/i:98a543410c] should include a BUGS section.Big thanks,
Jason

 
Profile Email
 Quote
   
Content generated in: 0.12 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login