ЭЛЕКТРОННАЯ БИБЛИОТЕКА КОАПП
Сборники Художественной, Технической, Справочной, Английской, Нормативной, Исторической, и др. литературы.



fcntl

fcntl filehandle, function, arg

Calls the file control function (with the function-specific arg) to use on the file or device opened with filehandle. fcntl calls Unix's fcntl function (not available on Win32 platforms). If the function is not implemented, the program exits with a fatal error. fcntl sets file descriptors for a filehandle. This built-in command is usable when you use the Fcntl module in the standard distribution:

use Fcntl;
This module imports the correct function definitions. See the description of the Fcntl module in Chapter 8, Standard Modules.

The return value of fcntl (and ioctl) is as follows:

System call returnsPerl returns
-1Undefined value
0String "0 but true"
Anything elseThat number

Thus Perl returns true on success and false on failure, yet you can still easily determine the actual value returned by the operating system.