Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > $! is set to "Inappropriate ioctl..." on Linux

Reply
Thread Tools

$! is set to "Inappropriate ioctl..." on Linux

 
 
amirkargerweb@yahoo.com
Guest
Posts: n/a
 
      01-12-2005
Hi.

Running perl5.8.* on Linux (more details later), I get:

==============
>echo 'hi' > zzz
>echo 'bye' >> zzz
>perl -we 'print ".$\!.\n";open FOO, "<zzz" or die "foo\n";print

".$\!.\n"; print <FOO>'
...
..Inappropriate ioctl for device.
hi
bye
==============

- Why is $! getting set if the open was successful?
- My open command seems pretty darn simple. Am I doing something wrong?
- Is this a known issue?

More details:
This problem happened on a variety of 2.4 RedHat Linux kernels (Intel
and AMD), plus Mandrake 2.6. It did NOT happen on OS X 10.3, Solaris 9
on SPARC, or Digital Unix.
Any thoughts?

Thanks,

-Amir Karger
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      01-12-2005
(E-Mail Removed) wrote:
> Hi.
>
> Running perl5.8.* on Linux (more details later), I get:
>
> ==============
> >echo 'hi' > zzz
> >echo 'bye' >> zzz
> >perl -we 'print ".$\!.\n";open FOO, "<zzz" or die "foo\n";print

> ".$\!.\n"; print <FOO>'
> ..
> .Inappropriate ioctl for device.
> hi
> bye
> ==============
>
> - Why is $! getting set if the open was successful?


Take a look at the friendly docs.

$! If used numerically, yields the current value of the C
"errno" variable, or in other words, if a system or library
call fails, it sets this variable. This means that the
value of $! is meaningful only immediately after a failure:

You aren't immediately after a failure. The value of $! is meaningless.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
 
Arndt Jonasson
Guest
Posts: n/a
 
      01-13-2005

(E-Mail Removed) writes:
>
> Running perl5.8.* on Linux (more details later), I get:
>
> ==============
> >echo 'hi' > zzz
> >echo 'bye' >> zzz
> >perl -we 'print ".$\!.\n";open FOO, "<zzz" or die "foo\n";print

> ".$\!.\n"; print <FOO>'
> ..
> .Inappropriate ioctl for device.


This is the classical Unix "Not a typewriter" error that appears
if you check 'errno' after doing some I/O although nothing went wrong.
The reason is usually that the standard I/O routines check whether
stdout is a terminal or not and sets buffering accordingly. This check
results in an error from a system call in case stdout is not a
"typewriter", i.e., "tty", i.e., terminal.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Is Netscape Leaving Firefox Behind on GNU/Linux? THE LINUX PROPAGANDA MACHINE CONTINUES. FIREFOX IGNORING LINUX............. traci.manicotti@gmail.com Computer Support 2 10-20-2007 02:12 PM
Linux... yeah linux.. Linux Have a nice cup of pee NZ Computing 19 04-17-2006 10:16 AM
Importing TB mail from linux in linux Nick de Graeve Firefox 0 10-04-2004 10:49 AM
Linux and vpnclient-linux-4.0.3.B-k9 install problem JSH Cisco 0 06-07-2004 03:56 AM
Linux-Cisco-ADSL-Cisco-Linux Connection hangs.... Adrian de los Santos Cisco 6 07-22-2003 04:44 AM



Advertisments