![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check if file is empty | stolz | Shell Programming and Scripting | 8 | 03-22-2009 11:15 PM |
| Perl FTP - check file size | rahulrathod | Shell Programming and Scripting | 1 | 02-20-2007 10:21 AM |
| How can I make the for command check to see if a file is empty before executing? | chrchcol | Shell Programming and Scripting | 3 | 07-29-2006 04:14 AM |
| printing an empty line in a file (perl) | kfad | Shell Programming and Scripting | 3 | 05-07-2005 04:10 AM |
| perl ftp check file exists | methos | Shell Programming and Scripting | 2 | 06-18-2003 09:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to check for empty file in Perl?
Hi,
May I know how to check for empty file in Perl. Iam missing something, somewhere. #!/usr/bin/perl my $open_dir = '/path/'; my $file; my $ma = "abc_.*.\.psv\$" opendir(VAR, $open_dir) or die "Can't open $oepn_dir: $!\n"; while( defined ($file = readdir VAR) ) #read all the files in the directory { if (($file =~ /$ma/i) && ( -s $file )) { print $file; } } It doest work. I doesnt give out any non empty file. pls correct me. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|