Welcome to iraf.net Friday, May 03 2024 @ 10:56 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 script cl issue
   
Chuck Horst
 01/05/2012 08:37AM (Read 998 times)  
+----
Newbie

Status: offline


Registered: 04/17/2010
Posts: 4
I am looking for a way to test if a file is empty or not in a script. I see access to see if a file exists. What would be a good way to tell if it is empty. The returned value would be used to test.Thanks...chuck

 
Profile Email
 Quote
fitz
 01/05/2012 08:37AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
See the COUNT task (similar to unix 'wc'), e.g.[code:1:ed61d16881]count ("/dev/null") | scan (nlines, nwords, nchars, fname)
if (nchars == 0) {
# file is empty ....
}[/code:1:ed61d16881]

 
Profile Email
 Quote
   
Content generated in: 0.08 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