CINXE.COM

Fcntl - various flag constants and helper functions from C's fcntl.h - Perldoc Browser

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Fcntl - various flag constants and helper functions from C&#39;s fcntl.h - Perldoc Browser</title> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser"> <link rel="canonical" href="https://perldoc.perl.org/Fcntl"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" /> <style> body { background: #f4f4f5; color: #020202; } .navbar-dark { background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%); background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%); background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0); background-repeat: repeat-x; } .navbar-dark .navbar-nav .nav-link, .navbar-dark .navbar-nav .nav-link:focus { color: #fff } .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 } #wrapperlicious { margin: 0 auto; font: 0.9em 'Helvetica Neue', Helvetica, sans-serif; font-weight: normal; line-height: 1.5em; margin: 0; padding: 0; } #wrapperlicious h1 { font-size: 1.5em } #wrapperlicious h2 { font-size: 1.3em } #wrapperlicious h3 { font-size: 1.1em } #wrapperlicious h4 { font-size: 0.9em } #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3, #wrapperlicious h4, #wrapperlicious dt { color: #020202; margin-top: 1em; margin-bottom: 1em; position: relative; font-weight: bold; } #wrapperlicious a { color: inherit; text-decoration: underline } #wrapperlicious #toc { text-decoration: none } #wrapperlicious a:hover { color: #2a2a2a } #wrapperlicious a img { border: 0 } #wrapperlicious :not(pre) > code { color: inherit; background-color: rgba(0, 0, 0, 0.04); border-radius: 3px; font: 0.9em Consolas, Menlo, Monaco, monospace; padding: 0.3em; } #wrapperlicious dd { margin: 0; margin-left: 2em; } #wrapperlicious dt { color: #2a2a2a; font-weight: bold; margin-left: 0.9em; } #wrapperlicious p { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious li > p { margin-bottom: 0; margin-top: 0; } #wrapperlicious pre { border: 1px solid #c1c1c1; border-radius: 3px; font: 100% Consolas, Menlo, Monaco, monospace; margin-bottom: 1em; margin-top: 1em; } #wrapperlicious pre > code { display: block; background-color: #f6f6f6; font: 0.9em Consolas, Menlo, Monaco, monospace; line-height: 1.5em; text-align: left; white-space: pre; padding: 1em; } #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious ul { list-style-type: square; } #wrapperlicious ul ul { margin-bottom: 0px; margin-top: 0px; } #footer { font-size: 0.8em; padding-top: 0.5em; text-align: center; } #more { display: inline; font-size: 0.8em; } #perldocdiv { background-color: #fff; border: 1px solid #c1c1c1; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; margin-left: auto; margin-right: auto; padding: 3em; padding-top: 1em; max-width: 960px; } #moduleversion { float: right } #wrapperlicious .leading-notice { font-style: italic; padding-left: 1em; margin-top: 1em; margin-bottom: 1em; } #wrapperlicious .permalink { display: none; left: -0.75em; position: absolute; padding-right: 0.25em; text-decoration: none; } #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink, #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink, #wrapperlicious dt:hover .permalink { display: block; } </style> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-KVNWBNT5FB'); gtag('config', 'UA-50555-3'); </script> </head> <body> <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="/"><img src="/images/perl_camel_30.png" width="30" height="30" class="d-inline-block align-top" alt="Perl Camel Logo"> Perldoc Browser</a> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.41.2</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-stable"> <a class="dropdown-item" href="/Fcntl">Latest</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1/Fcntl">5.40.1</a> <a class="dropdown-item" href="/5.40.0/Fcntl">5.40.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3/Fcntl">5.38.3</a> <a class="dropdown-item" href="/5.38.2/Fcntl">5.38.2</a> <a class="dropdown-item" href="/5.38.1/Fcntl">5.38.1</a> <a class="dropdown-item" href="/5.38.0/Fcntl">5.38.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.36.3/Fcntl">5.36.3</a> <a class="dropdown-item" href="/5.36.2/Fcntl">5.36.2</a> <a class="dropdown-item" href="/5.36.1/Fcntl">5.36.1</a> <a class="dropdown-item" href="/5.36.0/Fcntl">5.36.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.34.3/Fcntl">5.34.3</a> <a class="dropdown-item" href="/5.34.2/Fcntl">5.34.2</a> <a class="dropdown-item" href="/5.34.1/Fcntl">5.34.1</a> <a class="dropdown-item" href="/5.34.0/Fcntl">5.34.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.32.1/Fcntl">5.32.1</a> <a class="dropdown-item" href="/5.32.0/Fcntl">5.32.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.30.3/Fcntl">5.30.3</a> <a class="dropdown-item" href="/5.30.2/Fcntl">5.30.2</a> <a class="dropdown-item" href="/5.30.1/Fcntl">5.30.1</a> <a class="dropdown-item" href="/5.30.0/Fcntl">5.30.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.28.3/Fcntl">5.28.3</a> <a class="dropdown-item" href="/5.28.2/Fcntl">5.28.2</a> <a class="dropdown-item" href="/5.28.1/Fcntl">5.28.1</a> <a class="dropdown-item" href="/5.28.0/Fcntl">5.28.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.26.3/Fcntl">5.26.3</a> <a class="dropdown-item" href="/5.26.2/Fcntl">5.26.2</a> <a class="dropdown-item" href="/5.26.1/Fcntl">5.26.1</a> <a class="dropdown-item" href="/5.26.0/Fcntl">5.26.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.24.4/Fcntl">5.24.4</a> <a class="dropdown-item" href="/5.24.3/Fcntl">5.24.3</a> <a class="dropdown-item" href="/5.24.2/Fcntl">5.24.2</a> <a class="dropdown-item" href="/5.24.1/Fcntl">5.24.1</a> <a class="dropdown-item" href="/5.24.0/Fcntl">5.24.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.22.4/Fcntl">5.22.4</a> <a class="dropdown-item" href="/5.22.3/Fcntl">5.22.3</a> <a class="dropdown-item" href="/5.22.2/Fcntl">5.22.2</a> <a class="dropdown-item" href="/5.22.1/Fcntl">5.22.1</a> <a class="dropdown-item" href="/5.22.0/Fcntl">5.22.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.20.3/Fcntl">5.20.3</a> <a class="dropdown-item" href="/5.20.2/Fcntl">5.20.2</a> <a class="dropdown-item" href="/5.20.1/Fcntl">5.20.1</a> <a class="dropdown-item" href="/5.20.0/Fcntl">5.20.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.18.4/Fcntl">5.18.4</a> <a class="dropdown-item" href="/5.18.3/Fcntl">5.18.3</a> <a class="dropdown-item" href="/5.18.2/Fcntl">5.18.2</a> <a class="dropdown-item" href="/5.18.1/Fcntl">5.18.1</a> <a class="dropdown-item" href="/5.18.0/Fcntl">5.18.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.16.3/Fcntl">5.16.3</a> <a class="dropdown-item" href="/5.16.2/Fcntl">5.16.2</a> <a class="dropdown-item" href="/5.16.1/Fcntl">5.16.1</a> <a class="dropdown-item" href="/5.16.0/Fcntl">5.16.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.14.4/Fcntl">5.14.4</a> <a class="dropdown-item" href="/5.14.3/Fcntl">5.14.3</a> <a class="dropdown-item" href="/5.14.2/Fcntl">5.14.2</a> <a class="dropdown-item" href="/5.14.1/Fcntl">5.14.1</a> <a class="dropdown-item" href="/5.14.0/Fcntl">5.14.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.12.5/Fcntl">5.12.5</a> <a class="dropdown-item" href="/5.12.4/Fcntl">5.12.4</a> <a class="dropdown-item" href="/5.12.3/Fcntl">5.12.3</a> <a class="dropdown-item" href="/5.12.2/Fcntl">5.12.2</a> <a class="dropdown-item" href="/5.12.1/Fcntl">5.12.1</a> <a class="dropdown-item" href="/5.12.0/Fcntl">5.12.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.10.1/Fcntl">5.10.1</a> <a class="dropdown-item" href="/5.10.0/Fcntl">5.10.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.9/Fcntl">5.8.9</a> <a class="dropdown-item" href="/5.8.8/Fcntl">5.8.8</a> <a class="dropdown-item" href="/5.8.7/Fcntl">5.8.7</a> <a class="dropdown-item" href="/5.8.6/Fcntl">5.8.6</a> <a class="dropdown-item" href="/5.8.5/Fcntl">5.8.5</a> <a class="dropdown-item" href="/5.8.4/Fcntl">5.8.4</a> <a class="dropdown-item" href="/5.8.3/Fcntl">5.8.3</a> <a class="dropdown-item" href="/5.8.2/Fcntl">5.8.2</a> <a class="dropdown-item" href="/5.8.1/Fcntl">5.8.1</a> <a class="dropdown-item" href="/5.8.0/Fcntl">5.8.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.2/Fcntl">5.6.2</a> <a class="dropdown-item" href="/5.6.1/Fcntl">5.6.1</a> <a class="dropdown-item" href="/5.6.0/Fcntl">5.6.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.005_04/Fcntl">5.005_04</a> <a class="dropdown-item" href="/5.005_03/Fcntl">5.005_03</a> <a class="dropdown-item" href="/5.005_02/Fcntl">5.005_02</a> <a class="dropdown-item" href="/5.005_01/Fcntl">5.005_01</a> <a class="dropdown-item" href="/5.005/Fcntl">5.005</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-dev"> <a class="dropdown-item" href="/blead/Fcntl">blead</a> <a class="dropdown-item" href="/5.41.9/Fcntl">5.41.9</a> <a class="dropdown-item" href="/5.41.8/Fcntl">5.41.8</a> <a class="dropdown-item" href="/5.41.7/Fcntl">5.41.7</a> <a class="dropdown-item" href="/5.41.6/Fcntl">5.41.6</a> <a class="dropdown-item" href="/5.41.5/Fcntl">5.41.5</a> <a class="dropdown-item" href="/5.41.4/Fcntl">5.41.4</a> <a class="dropdown-item" href="/5.41.3/Fcntl">5.41.3</a> <a class="dropdown-item active" href="/5.41.2/Fcntl">5.41.2</a> <a class="dropdown-item" href="/5.41.1/Fcntl">5.41.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1-RC1/Fcntl">5.40.1-RC1</a> <a class="dropdown-item" href="/5.40.0-RC2/Fcntl">5.40.0-RC2</a> <a class="dropdown-item" href="/5.40.0-RC1/Fcntl">5.40.0-RC1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.39.10/Fcntl">5.39.10</a> <a class="dropdown-item" href="/5.39.9/Fcntl">5.39.9</a> <a class="dropdown-item" href="/5.39.8/Fcntl">5.39.8</a> <a class="dropdown-item" href="/5.39.7/Fcntl">5.39.7</a> <a class="dropdown-item" href="/5.39.6/Fcntl">5.39.6</a> <a class="dropdown-item" href="/5.39.5/Fcntl">5.39.5</a> <a class="dropdown-item" href="/5.39.4/Fcntl">5.39.4</a> <a class="dropdown-item" href="/5.39.3/Fcntl">5.39.3</a> <a class="dropdown-item" href="/5.39.2/Fcntl">5.39.2</a> <a class="dropdown-item" href="/5.39.1/Fcntl">5.39.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3-RC1/Fcntl">5.38.3-RC1</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-nav"> <a class="dropdown-item" href="/5.41.2/perl">Perl</a> <a class="dropdown-item" href="/5.41.2/perlintro">Intro</a> <a class="dropdown-item" href="/5.41.2/perl#Tutorials">Tutorials</a> <a class="dropdown-item" href="/5.41.2/perlfaq">FAQs</a> <a class="dropdown-item" href="/5.41.2/perl#Reference-Manual">Reference</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.41.2/perlop">Operators</a> <a class="dropdown-item" href="/5.41.2/functions">Functions</a> <a class="dropdown-item" href="/5.41.2/variables">Variables</a> <a class="dropdown-item" href="/5.41.2/modules">Modules</a> <a class="dropdown-item" href="/5.41.2/perlutil">Utilities</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.41.2/perldelta">Release Notes</a> <a class="dropdown-item" href="/5.41.2/perlcommunity">Community</a> <a class="dropdown-item" href="/5.41.2/perlhist">History</a> </div> </li> </ul> <ul class="navbar-nav"> <script> function set_expand (expand) { var perldocdiv = document.getElementById('perldocdiv'); var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width'); var expanded = (width == '' || width == 'none') ? true : false; if (expand === null) { expand = !expanded; } if ((expand && !expanded) || (!expand && expanded)) { perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px'); var button_classlist = document.getElementById('content-expand-button').classList; if (expand) { button_classlist.add('btn-light'); button_classlist.remove('btn-outline-light'); } else { button_classlist.add('btn-outline-light'); button_classlist.remove('btn-light'); } } return expand; } function toggle_expand () { var expand = set_expand(null); document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC'; } function read_expand () { return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { if (read_expand()) { set_expand(true); } }); } else if (read_expand()) { set_expand(true); } </script> <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-4" onclick="toggle_expand()">Expand</button> </ul> <form class="form-inline" method="get" action="/5.41.2/search"> <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search" value=""> </form> </div> </nav> <div id="wrapperlicious" class="container-fluid"> <div id="perldocdiv"> <div id="links"> <a href="/5.41.2/Fcntl">Fcntl</a> <div id="more"> (<a href="/5.41.2/Fcntl.txt">source</a>, <a href="https://metacpan.org/pod/Fcntl">CPAN</a>) </div> <div id="moduleversion">version 1.19</div> </div> <div class="leading-notice"> You are viewing the version of this documentation from Perl 5.41.2. This is a development version of Perl. </div> <div class="leading-notice"> <strong>Fcntl</strong> may also refer to the function: <a href="/5.41.2/functions/fcntl">fcntl</a> </div> <h1><a id="toc">CONTENTS</a></h1> <ul> <li> <a class="text-decoration-none" href="#NAME">NAME</a> </li> <li> <a class="text-decoration-none" href="#SYNOPSIS">SYNOPSIS</a> </li> <li> <a class="text-decoration-none" href="#DESCRIPTION">DESCRIPTION</a> </li> <li> <a class="text-decoration-none" href="#EXPORTED-SYMBOLS">EXPORTED SYMBOLS</a> <ul> <li> <a class="text-decoration-none" href="#Default-exports-and-export-tags">Default exports and export tags</a> </li> <li> <a class="text-decoration-none" href="#Symbols-for-use-with-fcntl">Symbols for use with fcntl</a> </li> <li> <a class="text-decoration-none" href="#Symbols-for-use-with-flock">Symbols for use with flock</a> </li> <li> <a class="text-decoration-none" href="#Symbols-for-use-with-sysopen">Symbols for use with sysopen</a> </li> <li> <a class="text-decoration-none" href="#Symbols-for-use-with-seek-and-sysseek">Symbols for use with seek and sysseek</a> </li> <li> <a class="text-decoration-none" href="#Symbols-for-use-with-stat-and-chmod">Symbols for use with stat and chmod</a> </li> </ul> </li> <li> <a class="text-decoration-none" href="#SEE-ALSO">SEE ALSO</a> </li> <li> <a class="text-decoration-none" href="#APPENDIX-A">APPENDIX A</a> </li> </ul> <h1 id="NAME"><a class="permalink" href="#NAME">#</a>NAME</h1> <p>Fcntl - various flag constants and helper functions from C&#39;s fcntl.h</p> <h1 id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">#</a>SYNOPSIS</h1> <pre><code>use Fcntl; use Fcntl qw(:DEFAULT :flock); use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);</code></pre> <h1 id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">#</a>DESCRIPTION</h1> <p>This module provides flags and helper functions for use with <a href="/5.41.2/perlfunc#chmod">&quot;chmod&quot; in perlfunc</a> (S_*), <a href="/5.41.2/perlfunc#fcntl">&quot;fcntl&quot; in perlfunc</a> (F_*), <a href="/5.41.2/perlfunc#flock">&quot;flock&quot; in perlfunc</a> (LOCK_*), <a href="/5.41.2/perlfunc#seek">&quot;seek&quot; in perlfunc</a> (SEEK_*), <a href="/5.41.2/perlfunc#stat">&quot;stat&quot; in perlfunc</a> (S_*), <a href="/5.41.2/perlfunc#sysopen">&quot;sysopen&quot; in perlfunc</a> (O_*), and <a href="/5.41.2/perlfunc#sysseek">&quot;sysseek&quot; in perlfunc</a> (SEEK_*). They correspond to the C macros defined in <i>fcntl.h</i>.</p> <p>Not all symbols are available on all systems. Except where noted otherwise, the constants and functions provided by this module will throw a runtime exception if the corresponding C macro is not available. Consult your system documentation to see the full description of each symbol and whether it is available on your platform: <a href="http://man.he.net/man2/chmod">chmod(2)</a>, <a href="http://man.he.net/man2/fcntl">fcntl(2)</a>, <a href="http://man.he.net/man2/flock">flock(2)</a>, <a href="http://man.he.net/man2/lseek">lseek(2)</a>, <a href="http://man.he.net/man2/open">open(2)</a>, <a href="http://man.he.net/man2/stat">stat(2)</a>.</p> <p>(In particular, some of the F_* symbols are highly non-portable because they only exist on a single platform or require system-specific C data structures to be passed as the third argument to <code>fcntl</code>, which can&#39;t be portably constructed in pure Perl.)</p> <h1 id="EXPORTED-SYMBOLS"><a class="permalink" href="#EXPORTED-SYMBOLS">#</a><a id="EXPORTED"></a>EXPORTED SYMBOLS</h1> <h2 id="Default-exports-and-export-tags"><a class="permalink" href="#Default-exports-and-export-tags">#</a><a id="Default"></a>Default exports and export tags</h2> <p>The full list of default exports can be found below in <a href="#APPENDIX-A">&quot;APPENDIX A&quot;</a>.</p> <p>In addition, the following export tags are available (see <a href="/5.41.2/Exporter">Exporter</a> for more information on export tags):</p> <dl> <dt id=":DEFAULT"><a class="permalink" href="#:DEFAULT">#</a><a id="DEFAULT"></a><code>:DEFAULT</code></dt> <dd> <p>Equivalent to the list of default export symbols (see <a href="#APPENDIX-A">&quot;APPENDIX A&quot;</a>).</p> </dd> <dt id=":flock"><a class="permalink" href="#:flock">#</a><a id="flock"></a><code>:flock</code></dt> <dd> <p>Equivalent to all LOCK_* symbols listed below.</p> </dd> <dt id=":mode"><a class="permalink" href="#:mode">#</a><a id="mode"></a><code>:mode</code></dt> <dd> <p>Equivalent to all S_* symbols listed below.</p> </dd> <dt id=":seek"><a class="permalink" href="#:seek">#</a><a id="seek"></a><code>:seek</code></dt> <dd> <p>Equivalent to all SEEK_* symbols listed below.</p> </dd> <dt id=":Fcompat"><a class="permalink" href="#:Fcompat">#</a><a id="Fcompat"></a><code>:Fcompat</code></dt> <dd> <p>Equivalent to <code>qw(FAPPEND FASYNC FCREAT FDEFER FDSYNC FEXCL FLARGEFILE FNDELAY FNONBLOCK FRSYNC FSYNC FTRUNC)</code>. These only exist for compatibility with old code (if your platform defines them at all) and should not be used in new code.</p> </dd> </dl> <h2 id="Symbols-for-use-with-fcntl"><a class="permalink" href="#Symbols-for-use-with-fcntl">#</a><a id="Symbols"></a>Symbols for use with <code>fcntl</code></h2> <dl> <dt id="F_ALLOCSP"><a class="permalink" href="#F_ALLOCSP">#</a><code>F_ALLOCSP</code></dt> <dd> <p>File storage manipulation.</p> </dd> <dt id="F_ALLOCSP64"><a class="permalink" href="#F_ALLOCSP64">#</a><code>F_ALLOCSP64</code></dt> <dd> <p>File storage manipulation.</p> </dd> <dt id="F_DUP2FD"><a class="permalink" href="#F_DUP2FD">#</a><code>F_DUP2FD</code></dt> <dd> <p>Duplicate a file descriptor to the number specified in the third argument to <code>fcntl</code> (if it refers to an open file, it is automatically closed first).</p> </dd> <dt id="F_DUPFD"><a class="permalink" href="#F_DUPFD">#</a><code>F_DUPFD</code></dt> <dd> <p>Duplicate a file descriptor to the lowest unused number greater than or equal to the third argument of <code>fcntl</code>.</p> </dd> <dt id="F_FREESP"><a class="permalink" href="#F_FREESP">#</a><code>F_FREESP</code></dt> <dd> <p>File storage manipulation.</p> </dd> <dt id="F_FREESP64"><a class="permalink" href="#F_FREESP64">#</a><code>F_FREESP64</code></dt> <dd> <p>File storage manipulation.</p> </dd> <dt id="F_FSYNC"><a class="permalink" href="#F_FSYNC">#</a><code>F_FSYNC</code></dt> <dd> <p>Synchronize file data to disk.</p> </dd> <dt id="F_FSYNC64"><a class="permalink" href="#F_FSYNC64">#</a><code>F_FSYNC64</code></dt> <dd> <p>Synchronize file data to disk.</p> </dd> <dt id="F_GETFD"><a class="permalink" href="#F_GETFD">#</a><code>F_GETFD</code></dt> <dd> <p>Return (as a number) the set of file descriptor flags, in which the following bits may be set:</p> <dl> <dt id="FD_CLOEXEC"><a class="permalink" href="#FD_CLOEXEC">#</a><code>FD_CLOEXEC</code></dt> <dd> <p>During a successful <code>exec</code> call, the file descriptor will be closed automatically.</p> </dd> </dl> </dd> <dt id="F_GETFL"><a class="permalink" href="#F_GETFL">#</a><code>F_GETFL</code></dt> <dd> <p>Return (as a number) the set of file description status flags (O_*) as set by <code>open</code> and <code>fcntl</code>. To determine the file access mode, perform a bitwise AND with <a href="#O_ACCMODE">&quot;<code>O_ACCMODE</code>&quot;</a> and see whether the result is equal to <code>O_RDONLY</code>, <code>O_WRONLY</code>, or <code>O_RDWR</code>.</p> </dd> <dt id="F_GETLEASE"><a class="permalink" href="#F_GETLEASE">#</a><code>F_GETLEASE</code></dt> <dd> <p>Indicate the type of lease associated with the filehandle (if any) by returning one of the following flags:</p> <dl> <dt id="F_RDLCK"><a class="permalink" href="#F_RDLCK">#</a><code>F_RDLCK</code></dt> <dd> <p>A read lease.</p> </dd> <dt id="F_WRLCK"><a class="permalink" href="#F_WRLCK">#</a><code>F_WRLCK</code></dt> <dd> <p>A write lease.</p> </dd> <dt id="F_UNLCK"><a class="permalink" href="#F_UNLCK">#</a><code>F_UNLCK</code></dt> <dd> <p>No lease.</p> </dd> </dl> </dd> <dt id="F_GETLK"><a class="permalink" href="#F_GETLK">#</a><code>F_GETLK</code></dt> <dd> <p>Test for the existence of record locks on the file.</p> </dd> <dt id="F_GETLK64"><a class="permalink" href="#F_GETLK64">#</a><code>F_GETLK64</code></dt> <dd> <p>Test for the existence of record locks on the file.</p> </dd> <dt id="F_GETOWN"><a class="permalink" href="#F_GETOWN">#</a><code>F_GETOWN</code></dt> <dd> <p>Return the ID of the process (as a positive number) or group (as a negative number) that is currently receiving signals for events on the file descriptor.</p> </dd> <dt id="F_GETPIPE_SZ"><a class="permalink" href="#F_GETPIPE_SZ">#</a><code>F_GETPIPE_SZ</code></dt> <dd> <p>Return the capacity of the pipe associated with the filehandle.</p> </dd> <dt id="F_GETSIG"><a class="permalink" href="#F_GETSIG">#</a><code>F_GETSIG</code></dt> <dd> <p>Return the number of the signal sent when input or output becomes possible on the filehandle. A return value of <code>0</code> means <code>SIGIO</code>.</p> </dd> <dt id="F_NOTIFY"><a class="permalink" href="#F_NOTIFY">#</a><code>F_NOTIFY</code></dt> <dd> <p>File and directory change notification with signals.</p> <dl> <dt id="DN_ACCESS"><a class="permalink" href="#DN_ACCESS">#</a><code>DN_ACCESS</code></dt> <dd> </dd> <dt id="DN_ATTRIB"><a class="permalink" href="#DN_ATTRIB">#</a><code>DN_ATTRIB</code></dt> <dd> </dd> <dt id="DN_CREATE"><a class="permalink" href="#DN_CREATE">#</a><code>DN_CREATE</code></dt> <dd> </dd> <dt id="DN_DELETE"><a class="permalink" href="#DN_DELETE">#</a><code>DN_DELETE</code></dt> <dd> </dd> <dt id="DN_MODIFY"><a class="permalink" href="#DN_MODIFY">#</a><code>DN_MODIFY</code></dt> <dd> </dd> <dt id="DN_MULTISHOT"><a class="permalink" href="#DN_MULTISHOT">#</a><code>DN_MULTISHOT</code></dt> <dd> </dd> <dt id="DN_RENAME"><a class="permalink" href="#DN_RENAME">#</a><code>DN_RENAME</code></dt> <dd> </dd> </dl> <p></p> </dd> <dt id="F_SETFD"><a class="permalink" href="#F_SETFD">#</a><code>F_SETFD</code></dt> <dd> <p>Set the file descriptor flags. See <a href="#F_GETFD">&quot;<code>F_GETFD</code>&quot;</a> for the list of available flags.</p> </dd> <dt id="F_SETFL"><a class="permalink" href="#F_SETFL">#</a><code>F_SETFL</code></dt> <dd> <p>Set the file description status flags (O_*). Only some flags can be changed this way.</p> </dd> <dt id="F_SETLEASE"><a class="permalink" href="#F_SETLEASE">#</a><code>F_SETLEASE</code></dt> <dd> <p>Set a file lease as specified by the third <code>fnctl</code> argument, which must be one of the following:</p> <dl> <dt id="F_RDLCK1"><a class="permalink" href="#F_RDLCK1">#</a><code>F_RDLCK</code></dt> <dd> <p>Set a read lease.</p> </dd> <dt id="F_WRLCK1"><a class="permalink" href="#F_WRLCK1">#</a><code>F_WRLCK</code></dt> <dd> <p>Set a write lease.</p> </dd> <dt id="F_UNLCK1"><a class="permalink" href="#F_UNLCK1">#</a><code>F_UNLCK</code></dt> <dd> <p>Remove a lease.</p> </dd> </dl> </dd> <dt id="F_SETLK"><a class="permalink" href="#F_SETLK">#</a><code>F_SETLK</code></dt> <dd> <p>Acquire a record lock.</p> </dd> <dt id="F_SETLK64"><a class="permalink" href="#F_SETLK64">#</a><code>F_SETLK64</code></dt> <dd> <p>Acquire a record lock.</p> </dd> <dt id="F_SETLKW"><a class="permalink" href="#F_SETLKW">#</a><code>F_SETLKW</code></dt> <dd> <p>Acquire a record lock and wait for conflicting locks to be released.</p> </dd> <dt id="F_SETLKW64"><a class="permalink" href="#F_SETLKW64">#</a><code>F_SETLKW64</code></dt> <dd> <p>Acquire a record lock and wait for conflicting locks to be released.</p> </dd> <dt id="F_SETOWN"><a class="permalink" href="#F_SETOWN">#</a><code>F_SETOWN</code></dt> <dd> <p>Set the ID of the process (as a positive number) or group (as a negative number) that will receive signals for events on the file descriptor.</p> </dd> <dt id="F_SETPIPE_SZ"><a class="permalink" href="#F_SETPIPE_SZ">#</a><code>F_SETPIPE_SZ</code></dt> <dd> <p>Set the capacity of the pipe associated with the filehandle. Return the actual capacity reserved for the pipe, which may be higher than requested.</p> </dd> <dt id="F_SETSIG"><a class="permalink" href="#F_SETSIG">#</a><code>F_SETSIG</code></dt> <dd> <p>Set the number of the signal sent when input or output becomes possible on the filehandle. An argument of <code>0</code> means <code>SIGIO</code>.</p> </dd> <dt id="F_SHARE"><a class="permalink" href="#F_SHARE">#</a><code>F_SHARE</code></dt> <dd> <p>Set share reservation.</p> </dd> <dt id="F_UNSHARE"><a class="permalink" href="#F_UNSHARE">#</a><code>F_UNSHARE</code></dt> <dd> <p>Remove share reservation.</p> </dd> <dt id="F_COMPAT"><a class="permalink" href="#F_COMPAT">#</a><code>F_COMPAT</code></dt> <dd> </dd> <dt id="F_EXLCK"><a class="permalink" href="#F_EXLCK">#</a><code>F_EXLCK</code></dt> <dd> </dd> <dt id="F_NODNY"><a class="permalink" href="#F_NODNY">#</a><code>F_NODNY</code></dt> <dd> </dd> <dt id="F_POSIX"><a class="permalink" href="#F_POSIX">#</a><code>F_POSIX</code></dt> <dd> </dd> <dt id="F_RDACC"><a class="permalink" href="#F_RDACC">#</a><code>F_RDACC</code></dt> <dd> </dd> <dt id="F_RDDNY"><a class="permalink" href="#F_RDDNY">#</a><code>F_RDDNY</code></dt> <dd> </dd> <dt id="F_RWACC"><a class="permalink" href="#F_RWACC">#</a><code>F_RWACC</code></dt> <dd> </dd> <dt id="F_RWDNY"><a class="permalink" href="#F_RWDNY">#</a><code>F_RWDNY</code></dt> <dd> </dd> <dt id="F_SHLCK"><a class="permalink" href="#F_SHLCK">#</a><code>F_SHLCK</code></dt> <dd> </dd> <dt id="F_WRACC"><a class="permalink" href="#F_WRACC">#</a><code>F_WRACC</code></dt> <dd> </dd> <dt id="F_WRDNY"><a class="permalink" href="#F_WRDNY">#</a><code>F_WRDNY</code></dt> <dd> </dd> </dl> <h2 id="Symbols-for-use-with-flock"><a class="permalink" href="#Symbols-for-use-with-flock">#</a><a id="Symbols1"></a>Symbols for use with <code>flock</code></h2> <dl> <dt id="LOCK_EX"><a class="permalink" href="#LOCK_EX">#</a><code>LOCK_EX</code></dt> <dd> <p>Request an exclusive lock.</p> </dd> <dt id="LOCK_MAND"><a class="permalink" href="#LOCK_MAND">#</a><code>LOCK_MAND</code></dt> <dd> <p>Request a mandatory lock.</p> </dd> <dt id="LOCK_NB"><a class="permalink" href="#LOCK_NB">#</a><code>LOCK_NB</code></dt> <dd> <p>Make lock request non-blocking (can be combined with other LOCK_* flags using bitwise OR).</p> </dd> <dt id="LOCK_READ"><a class="permalink" href="#LOCK_READ">#</a><code>LOCK_READ</code></dt> <dd> <p>With <code>LOCK_MAND</code>: Allow concurrent reads.</p> </dd> <dt id="LOCK_RW"><a class="permalink" href="#LOCK_RW">#</a><code>LOCK_RW</code></dt> <dd> <p>With <code>LOCK_MAND</code>: Allow concurrent reads and writes.</p> </dd> <dt id="LOCK_SH"><a class="permalink" href="#LOCK_SH">#</a><code>LOCK_SH</code></dt> <dd> <p>Request a shared lock.</p> </dd> <dt id="LOCK_UN"><a class="permalink" href="#LOCK_UN">#</a><code>LOCK_UN</code></dt> <dd> <p>Release a held lock.</p> </dd> <dt id="LOCK_WRITE"><a class="permalink" href="#LOCK_WRITE">#</a><code>LOCK_WRITE</code></dt> <dd> <p>With <code>LOCK_MAND</code>: Allow concurrent writes.</p> </dd> </dl> <h2 id="Symbols-for-use-with-sysopen"><a class="permalink" href="#Symbols-for-use-with-sysopen">#</a><a id="Symbols2"></a>Symbols for use with <code>sysopen</code></h2> <dl> <dt id="O_ACCMODE"><a class="permalink" href="#O_ACCMODE">#</a><code>O_ACCMODE</code></dt> <dd> <p>Bit mask for extracting the file access mode (read-only, write-only, or read/write) from the other flags. This is mainly useful in combination with <a href="#F_GETFL">&quot;<code>F_GETFL</code>&quot;</a>.</p> </dd> <dt id="O_ALIAS"><a class="permalink" href="#O_ALIAS">#</a><code>O_ALIAS</code></dt> <dd> <p>(Mac OS) Open alias file (instead of the file that the alias refers to).</p> </dd> <dt id="O_ALT_IO"><a class="permalink" href="#O_ALT_IO">#</a><code>O_ALT_IO</code></dt> <dd> <p>(NetBSD) Use alternative I/O semantics.</p> </dd> <dt id="O_APPEND"><a class="permalink" href="#O_APPEND">#</a><code>O_APPEND</code></dt> <dd> <p>Open the file in append mode. Writes always go to the end of the file.</p> </dd> <dt id="O_ASYNC"><a class="permalink" href="#O_ASYNC">#</a><code>O_ASYNC</code></dt> <dd> <p>Enable signal-based I/O. When the file becomes readable or writable, a signal is sent.</p> </dd> <dt id="O_BINARY"><a class="permalink" href="#O_BINARY">#</a><code>O_BINARY</code></dt> <dd> <p>(Windows) Open the file in binary mode.</p> </dd> <dt id="O_CREAT"><a class="permalink" href="#O_CREAT">#</a><code>O_CREAT</code></dt> <dd> <p>If the file to be opened does not exist yet, create it.</p> </dd> <dt id="O_DEFER"><a class="permalink" href="#O_DEFER">#</a><code>O_DEFER</code></dt> <dd> <p>(AIX) Changes to the file are kept in memory and not written to disk until the program performs an explicit <a href="/5.41.2/IO::Handle#%24io-%3Esync"><code>$fh-&gt;sync()</code></a>.</p> </dd> <dt id="O_DIRECT"><a class="permalink" href="#O_DIRECT">#</a><code>O_DIRECT</code></dt> <dd> <p>Perform direct I/O to/from user-space buffers; avoid caching at the OS level.</p> </dd> <dt id="O_DIRECTORY"><a class="permalink" href="#O_DIRECTORY">#</a><code>O_DIRECTORY</code></dt> <dd> <p>Fail if the filename to be opened does not refer to a directory.</p> </dd> <dt id="O_DSYNC"><a class="permalink" href="#O_DSYNC">#</a><code>O_DSYNC</code></dt> <dd> <p>Synchronize file data immediately, like calling <a href="http://man.he.net/man2/fdatasync">fdatasync(2)</a> after each write.</p> </dd> <dt id="O_EVTONLY"><a class="permalink" href="#O_EVTONLY">#</a><code>O_EVTONLY</code></dt> <dd> <p>(Mac OS) Open the file for event notifications, not reading or writing.</p> </dd> <dt id="O_EXCL"><a class="permalink" href="#O_EXCL">#</a><code>O_EXCL</code></dt> <dd> <p>If the file already exists, fail and set <code>$!</code> to <a href="/5.41.2/Errno"><code>EEXIST</code></a> (this only makes sense in combination with <code>O_CREAT</code>).</p> </dd> <dt id="O_EXLOCK"><a class="permalink" href="#O_EXLOCK">#</a><code>O_EXLOCK</code></dt> <dd> <p>When the file is opened, atomically obtain an exclusive lock.</p> </dd> <dt id="O_IGNORE_CTTY"><a class="permalink" href="#O_IGNORE_CTTY">#</a><code>O_IGNORE_CTTY</code></dt> <dd> <p>(Hurd) If the file to be opened is the controlling terminal for this process, don&#39;t recognize it as such. Operations on this filehandle won&#39;t trigger job control signals.</p> </dd> <dt id="O_LARGEFILE"><a class="permalink" href="#O_LARGEFILE">#</a><code>O_LARGEFILE</code></dt> <dd> <p>On 32-bit platforms, allow opening files whose size exceeds 2 GiB (2,147,483,647 bytes).</p> </dd> <dt id="O_NDELAY"><a class="permalink" href="#O_NDELAY">#</a><code>O_NDELAY</code></dt> <dd> <p>Compatibility symbol. Use <code>O_NONBLOCK</code> instead.</p> </dd> <dt id="O_NOATIME"><a class="permalink" href="#O_NOATIME">#</a><code>O_NOATIME</code></dt> <dd> <p>Don&#39;t update the access time of the file when reading from it.</p> </dd> <dt id="O_NOCTTY"><a class="permalink" href="#O_NOCTTY">#</a><code>O_NOCTTY</code></dt> <dd> <p>If the process does not have a controlling terminal and the file to be opened is a terminal device, don&#39;t make it the controlling terminal of the process.</p> </dd> <dt id="O_NOFOLLOW"><a class="permalink" href="#O_NOFOLLOW">#</a><code>O_NOFOLLOW</code></dt> <dd> <p>If the final component of the filename is a symbolic link, fail and set <code>$!</code> to <a href="/5.41.2/Errno"><code>ELOOP</code></a>.</p> </dd> <dt id="O_NOINHERIT"><a class="permalink" href="#O_NOINHERIT">#</a><code>O_NOINHERIT</code></dt> <dd> <p>(Windows) Don&#39;t let child processes inherit the opened file descriptor.</p> </dd> <dt id="O_NOLINK"><a class="permalink" href="#O_NOLINK">#</a><code>O_NOLINK</code></dt> <dd> <p>(Hurd) If the file to be opened is a symbolic link, don&#39;t follow it; open the link itself.</p> </dd> <dt id="O_NONBLOCK"><a class="permalink" href="#O_NONBLOCK">#</a><code>O_NONBLOCK</code></dt> <dd> <p>Open the file in non-blocking mode. Neither the open itself nor any read/write operations on the filehandle will block. (This is mainly useful for pipes and sockets. It has no effect on regular files.)</p> </dd> <dt id="O_NOSIGPIPE"><a class="permalink" href="#O_NOSIGPIPE">#</a><code>O_NOSIGPIPE</code></dt> <dd> <p>If the file to be opened is a pipe, then don&#39;t raise <code>SIGPIPE</code> for write operations when the read end of the pipe is closed; make the write fail with <code>EPIPE</code> instead.</p> </dd> <dt id="O_NOTRANS"><a class="permalink" href="#O_NOTRANS">#</a><code>O_NOTRANS</code></dt> <dd> <p>(Hurd) If the file to be opened is specially translated, don&#39;t invoke the translator; open the bare file itself.</p> </dd> <dt id="O_RANDOM"><a class="permalink" href="#O_RANDOM">#</a><code>O_RANDOM</code></dt> <dd> <p>(Windows) Indicate that the program intends to access the file contents randomly (without a predictable pattern). This is an optimization hint for the file cache (but may cause excessive memory use on large files).</p> </dd> <dt id="O_RAW"><a class="permalink" href="#O_RAW">#</a><code>O_RAW</code></dt> <dd> <p>(Windows) Same as <code>O_BINARY</code>.</p> </dd> <dt id="O_RDONLY"><a class="permalink" href="#O_RDONLY">#</a><code>O_RDONLY</code></dt> <dd> <p>Open the file for reading (only).</p> </dd> <dt id="O_RDWR"><a class="permalink" href="#O_RDWR">#</a><code>O_RDWR</code></dt> <dd> <p>Open the file for reading and writing.</p> </dd> <dt id="O_RSRC"><a class="permalink" href="#O_RSRC">#</a><code>O_RSRC</code></dt> <dd> <p>(Mac OS) Open the resource fork of the file.</p> </dd> <dt id="O_RSYNC"><a class="permalink" href="#O_RSYNC">#</a><code>O_RSYNC</code></dt> <dd> <p>Extend the effects of <code>O_SYNC</code> and <code>O_DSYNC</code> to read operations. In particular, reading from a filehandle opened with <code>O_SYNC | O_RSYNC</code> will wait until the access time of the file has been modified on disk.</p> </dd> <dt id="O_SEQUENTIAL"><a class="permalink" href="#O_SEQUENTIAL">#</a><code>O_SEQUENTIAL</code></dt> <dd> <p>(Windows) Indicate that the program intends to access the file contents sequentially. This is an optimization hint for the file cache.</p> </dd> <dt id="O_SHLOCK"><a class="permalink" href="#O_SHLOCK">#</a><code>O_SHLOCK</code></dt> <dd> <p>When the file is opened, atomically obtain a shared lock.</p> </dd> <dt id="O_SYMLINK"><a class="permalink" href="#O_SYMLINK">#</a><code>O_SYMLINK</code></dt> <dd> <p>If the file to be opened is a symbolic link, don&#39;t follow it; open the link itself.</p> </dd> <dt id="O_SYNC"><a class="permalink" href="#O_SYNC">#</a><code>O_SYNC</code></dt> <dd> <p>Synchronize file data and metadata immediately, like calling <a href="http://man.he.net/man2/fsync">fsync(2)</a> after each write.</p> </dd> <dt id="O_TEMPORARY"><a class="permalink" href="#O_TEMPORARY">#</a><code>O_TEMPORARY</code></dt> <dd> <p>(Windows) Delete the file when its last open file descriptor is closed.</p> </dd> <dt id="O_TEXT"><a class="permalink" href="#O_TEXT">#</a><code>O_TEXT</code></dt> <dd> <p>(Windows) Open the file in text mode.</p> </dd> <dt id="O_TMPFILE"><a class="permalink" href="#O_TMPFILE">#</a><code>O_TMPFILE</code></dt> <dd> <p>Create an unnamed temporary file. The filename argument specifies the directory the unnamed file should be placed in.</p> </dd> <dt id="O_TRUNC"><a class="permalink" href="#O_TRUNC">#</a><code>O_TRUNC</code></dt> <dd> <p>If the file already exists, truncate its contents to length 0.</p> </dd> <dt id="O_TTY_INIT"><a class="permalink" href="#O_TTY_INIT">#</a><code>O_TTY_INIT</code></dt> <dd> <p>If the file to be opened is a terminal that is not already open in any process, initialize its <a href="/5.41.2/POSIX#POSIX%3A%3ATermios">termios</a> parameters.</p> </dd> <dt id="O_WRONLY"><a class="permalink" href="#O_WRONLY">#</a><code>O_WRONLY</code></dt> <dd> <p>Open the file for writing (only).</p> </dd> <dt id="FAPPEND"><a class="permalink" href="#FAPPEND">#</a><code>FAPPEND</code></dt> <dd> <p>Compatibility symbol. Use <code>O_APPEND</code> instead.</p> </dd> <dt id="FASYNC"><a class="permalink" href="#FASYNC">#</a><code>FASYNC</code></dt> <dd> <p>Compatibility symbol. Use <code>O_ASYNC</code> instead.</p> </dd> <dt id="FCREAT"><a class="permalink" href="#FCREAT">#</a><code>FCREAT</code></dt> <dd> <p>Compatibility symbol. Use <code>O_CREAT</code> instead.</p> </dd> <dt id="FDEFER"><a class="permalink" href="#FDEFER">#</a><code>FDEFER</code></dt> <dd> <p>Compatibility symbol. Use <code>O_DEFER</code> instead.</p> </dd> <dt id="FDSYNC"><a class="permalink" href="#FDSYNC">#</a><code>FDSYNC</code></dt> <dd> <p>Compatibility symbol. Use <code>O_DSYNC</code> instead.</p> </dd> <dt id="FEXCL"><a class="permalink" href="#FEXCL">#</a><code>FEXCL</code></dt> <dd> <p>Compatibility symbol. Use <code>O_EXCL</code> instead.</p> </dd> <dt id="FLARGEFILE"><a class="permalink" href="#FLARGEFILE">#</a><code>FLARGEFILE</code></dt> <dd> <p>Compatibility symbol. Use <code>O_LARGEFILE</code> instead.</p> </dd> <dt id="FNDELAY"><a class="permalink" href="#FNDELAY">#</a><code>FNDELAY</code></dt> <dd> <p>Compatibility symbol. Use <code>O_NDELAY</code> instead.</p> </dd> <dt id="FNONBLOCK"><a class="permalink" href="#FNONBLOCK">#</a><code>FNONBLOCK</code></dt> <dd> <p>Compatibility symbol. Use <code>O_NONBLOCK</code> instead.</p> </dd> <dt id="FRSYNC"><a class="permalink" href="#FRSYNC">#</a><code>FRSYNC</code></dt> <dd> <p>Compatibility symbol. Use <code>O_RSYNC</code> instead.</p> </dd> <dt id="FSYNC"><a class="permalink" href="#FSYNC">#</a><code>FSYNC</code></dt> <dd> <p>Compatibility symbol. Use <code>O_SYNC</code> instead.</p> </dd> <dt id="FTRUNC"><a class="permalink" href="#FTRUNC">#</a><code>FTRUNC</code></dt> <dd> <p>Compatibility symbol. Use <code>O_TRUNC</code> instead.</p> </dd> </dl> <h2 id="Symbols-for-use-with-seek-and-sysseek"><a class="permalink" href="#Symbols-for-use-with-seek-and-sysseek">#</a><a id="Symbols3"></a>Symbols for use with <code>seek</code> and <code>sysseek</code></h2> <dl> <dt id="SEEK_CUR"><a class="permalink" href="#SEEK_CUR">#</a><code>SEEK_CUR</code></dt> <dd> <p>File offsets are relative to the current position in the file.</p> </dd> <dt id="SEEK_END"><a class="permalink" href="#SEEK_END">#</a><code>SEEK_END</code></dt> <dd> <p>File offsets are relative to the end of the file (i.e. mostly negative).</p> </dd> <dt id="SEEK_SET"><a class="permalink" href="#SEEK_SET">#</a><code>SEEK_SET</code></dt> <dd> <p>File offsets are absolute (i.e. relative to the beginning of the file).</p> </dd> </dl> <h2 id="Symbols-for-use-with-stat-and-chmod"><a class="permalink" href="#Symbols-for-use-with-stat-and-chmod">#</a><a id="Symbols4"></a>Symbols for use with <code>stat</code> and <code>chmod</code></h2> <dl> <dt id="S_ENFMT"><a class="permalink" href="#S_ENFMT">#</a><code>S_ENFMT</code></dt> <dd> <p>Enforce mandatory file locks. (This symbol typically shares its value with <code>S_ISGID</code>.)</p> </dd> <dt id="S_IEXEC"><a class="permalink" href="#S_IEXEC">#</a><code>S_IEXEC</code></dt> <dd> <p>Compatibility symbol. Use <code>S_IXUSR</code> instead.</p> </dd> <dt id="S_IFBLK"><a class="permalink" href="#S_IFBLK">#</a><code>S_IFBLK</code></dt> <dd> <p>File type: Block device.</p> </dd> <dt id="S_IFCHR"><a class="permalink" href="#S_IFCHR">#</a><code>S_IFCHR</code></dt> <dd> <p>File type: Character device.</p> </dd> <dt id="S_IFDIR"><a class="permalink" href="#S_IFDIR">#</a><code>S_IFDIR</code></dt> <dd> <p>File type: Directory.</p> </dd> <dt id="S_IFIFO"><a class="permalink" href="#S_IFIFO">#</a><code>S_IFIFO</code></dt> <dd> <p>File type: Fifo/pipe.</p> </dd> <dt id="S_IFLNK"><a class="permalink" href="#S_IFLNK">#</a><code>S_IFLNK</code></dt> <dd> <p>File type: Symbolic link.</p> </dd> <dt id="S_IFMT"><a class="permalink" href="#S_IFMT">#</a><code>S_IFMT</code></dt> <dd> <p>Bit mask for extracting the file type bits. This symbol can also be used as a function: <code>S_IFMT($mode)</code> acts like <code>$mode &amp; S_IFMT</code>. The result will be equal to one of the other S_IF* constants.</p> </dd> <dt id="_S_IFMT"><a class="permalink" href="#_S_IFMT">#</a><a id="S_IFMT1"></a><code>_S_IFMT</code></dt> <dd> <p>Bit mask for extracting the file type bits. This symbol is an actual constant and cannot be used as a function; otherwise it is identical to <code>S_IFMT</code>.</p> </dd> <dt id="S_IFREG"><a class="permalink" href="#S_IFREG">#</a><code>S_IFREG</code></dt> <dd> <p>File type: Regular file.</p> </dd> <dt id="S_IFSOCK"><a class="permalink" href="#S_IFSOCK">#</a><code>S_IFSOCK</code></dt> <dd> <p>File type: Socket.</p> </dd> <dt id="S_IFWHT"><a class="permalink" href="#S_IFWHT">#</a><code>S_IFWHT</code></dt> <dd> <p>File type: Whiteout file (used to mark the absence/deletion of a file in overlays).</p> </dd> <dt id="S_IMODE"><a class="permalink" href="#S_IMODE">#</a><code>S_IMODE</code></dt> <dd> <p>Function for extracting the permission bits from a file mode.</p> </dd> <dt id="S_IREAD"><a class="permalink" href="#S_IREAD">#</a><code>S_IREAD</code></dt> <dd> <p>Compatibility symbol. Use <code>S_IRUSR</code> instead.</p> </dd> <dt id="S_IRGRP"><a class="permalink" href="#S_IRGRP">#</a><code>S_IRGRP</code></dt> <dd> <p>Permissions: Readable by group.</p> </dd> <dt id="S_IROTH"><a class="permalink" href="#S_IROTH">#</a><code>S_IROTH</code></dt> <dd> <p>Permissions: Readable by others.</p> </dd> <dt id="S_IRUSR"><a class="permalink" href="#S_IRUSR">#</a><code>S_IRUSR</code></dt> <dd> <p>Permissions: Readable by owner.</p> </dd> <dt id="S_IRWXG"><a class="permalink" href="#S_IRWXG">#</a><code>S_IRWXG</code></dt> <dd> <p>Bit mask for extracting group permissions.</p> </dd> <dt id="S_IRWXO"><a class="permalink" href="#S_IRWXO">#</a><code>S_IRWXO</code></dt> <dd> <p>Bit mask for extracting other permissions.</p> </dd> <dt id="S_IRWXU"><a class="permalink" href="#S_IRWXU">#</a><code>S_IRWXU</code></dt> <dd> <p>Bit mask for extracting owner (&quot;user&quot;) permissions.</p> </dd> <dt id="S_ISBLK"><a class="permalink" href="#S_ISBLK">#</a><code>S_ISBLK</code></dt> <dd> <p>Convenience function to check for block devices: <code>S_ISBLK($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFBLK</code>.</p> </dd> <dt id="S_ISCHR"><a class="permalink" href="#S_ISCHR">#</a><code>S_ISCHR</code></dt> <dd> <p>Convenience function to check for character devices: <code>S_ISCHR($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFCHR</code>.</p> </dd> <dt id="S_ISDIR"><a class="permalink" href="#S_ISDIR">#</a><code>S_ISDIR</code></dt> <dd> <p>Convenience function to check for directories: <code>S_ISDIR($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFDIR</code>.</p> </dd> <dt id="S_ISFIFO"><a class="permalink" href="#S_ISFIFO">#</a><code>S_ISFIFO</code></dt> <dd> <p>Convenience function to check for fifos: <code>S_ISFIFO($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFIFO</code>.</p> </dd> <dt id="S_ISGID"><a class="permalink" href="#S_ISGID">#</a><code>S_ISGID</code></dt> <dd> <p>Permissions: Set effective group ID from file (when running executables); mandatory locking (on non-group-executable files); new files inherit their group from the directory (on directories).</p> </dd> <dt id="S_ISLNK"><a class="permalink" href="#S_ISLNK">#</a><code>S_ISLNK</code></dt> <dd> <p>Convenience function to check for symbolic links: <code>S_ISLNK($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFLNK</code>.</p> </dd> <dt id="S_ISREG"><a class="permalink" href="#S_ISREG">#</a><code>S_ISREG</code></dt> <dd> <p>Convenience function to check for regular files: <code>S_ISREG($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFREG</code>.</p> </dd> <dt id="S_ISSOCK"><a class="permalink" href="#S_ISSOCK">#</a><code>S_ISSOCK</code></dt> <dd> <p>Convenience function to check for sockets: <code>S_ISSOCK($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFSOCK</code>.</p> </dd> <dt id="S_ISTXT"><a class="permalink" href="#S_ISTXT">#</a><code>S_ISTXT</code></dt> <dd> <p>Compatibility symbol. Use <code>S_ISVTX</code> instead.</p> </dd> <dt id="S_ISUID"><a class="permalink" href="#S_ISUID">#</a><code>S_ISUID</code></dt> <dd> <p>Permissions: Set effective user ID from file (when running executables).</p> </dd> <dt id="S_ISVTX"><a class="permalink" href="#S_ISVTX">#</a><code>S_ISVTX</code></dt> <dd> <p>Permissions: Files in this directory can only be deleted/renamed by their owner (or the directory&#39;s owner), even if other users have write permissions to the directory (&quot;sticky bit&quot;).</p> </dd> <dt id="S_ISWHT"><a class="permalink" href="#S_ISWHT">#</a><code>S_ISWHT</code></dt> <dd> <p>Convenience function to check for whiteout files: <code>S_ISWHT($mode)</code> is equivalent to <code>S_IFMT($mode) == S_IFWHT</code>.</p> </dd> <dt id="S_IWGRP"><a class="permalink" href="#S_IWGRP">#</a><code>S_IWGRP</code></dt> <dd> <p>Permissions: Writable by group.</p> </dd> <dt id="S_IWOTH"><a class="permalink" href="#S_IWOTH">#</a><code>S_IWOTH</code></dt> <dd> <p>Permissions: Writable by others.</p> </dd> <dt id="S_IWRITE"><a class="permalink" href="#S_IWRITE">#</a><code>S_IWRITE</code></dt> <dd> <p>Compatibility symbol. Use <code>S_IWUSR</code> instead.</p> </dd> <dt id="S_IWUSR"><a class="permalink" href="#S_IWUSR">#</a><code>S_IWUSR</code></dt> <dd> <p>Permissions: Writable by owner.</p> </dd> <dt id="S_IXGRP"><a class="permalink" href="#S_IXGRP">#</a><code>S_IXGRP</code></dt> <dd> <p>Permissions: Executable/searchable by group.</p> </dd> <dt id="S_IXOTH"><a class="permalink" href="#S_IXOTH">#</a><code>S_IXOTH</code></dt> <dd> <p>Permissions: Executable/searchable by others.</p> </dd> <dt id="S_IXUSR"><a class="permalink" href="#S_IXUSR">#</a><code>S_IXUSR</code></dt> <dd> <p>Permissions: Executable/searchable by owner.</p> </dd> </dl> <h1 id="SEE-ALSO"><a class="permalink" href="#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1> <p><a href="/5.41.2/perlfunc#chmod">&quot;chmod&quot; in perlfunc</a>, <a href="http://man.he.net/man2/chmod">chmod(2)</a>, <a href="/5.41.2/perlfunc#fcntl">&quot;fcntl&quot; in perlfunc</a>, <a href="http://man.he.net/man2/fcntl">fcntl(2)</a>, <a href="/5.41.2/perlfunc#flock">&quot;flock&quot; in perlfunc</a>, <a href="http://man.he.net/man2/flock">flock(2)</a>, <a href="/5.41.2/perlfunc#seek">&quot;seek&quot; in perlfunc</a>, <a href="http://man.he.net/man3/fseek">fseek(3)</a>, <a href="/5.41.2/perlfunc#stat">&quot;stat&quot; in perlfunc</a>, <a href="http://man.he.net/man2/stat">stat(2)</a>, <a href="/5.41.2/perlfunc#sysopen">&quot;sysopen&quot; in perlfunc</a>, <a href="http://man.he.net/man2/open">open(2)</a>, <a href="/5.41.2/perlfunc#sysseek">&quot;sysseek&quot; in perlfunc</a>, <a href="http://man.he.net/man2/lseek">lseek(2)</a></p> <h1 id="APPENDIX-A"><a class="permalink" href="#APPENDIX-A">#</a><a id="APPENDIX"></a>APPENDIX A</h1> <p>By default, if you say <code>use Fcntl;</code>, the following symbols are exported:</p> <pre><code class="plaintext">FD_CLOEXEC F_ALLOCSP F_ALLOCSP64 F_COMPAT F_DUP2FD F_DUPFD F_EXLCK F_FREESP F_FREESP64 F_FSYNC F_FSYNC64 F_GETFD F_GETFL F_GETLK F_GETLK64 F_GETOWN F_NODNY F_POSIX F_RDACC F_RDDNY F_RDLCK F_RWACC F_RWDNY F_SETFD F_SETFL F_SETLK F_SETLK64 F_SETLKW F_SETLKW64 F_SETOWN F_SHARE F_SHLCK F_UNLCK F_UNSHARE F_WRACC F_WRDNY F_WRLCK O_ACCMODE O_ALIAS O_APPEND O_ASYNC O_BINARY O_CREAT O_DEFER O_DIRECT O_DIRECTORY O_DSYNC O_EXCL O_EXLOCK O_LARGEFILE O_NDELAY O_NOCTTY O_NOFOLLOW O_NOINHERIT O_NONBLOCK O_RANDOM O_RAW O_RDONLY O_RDWR O_RSRC O_RSYNC O_SEQUENTIAL O_SHLOCK O_SYNC O_TEMPORARY O_TEXT O_TRUNC O_WRONLY</code></pre> </div> <div id="footer"> <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p> <p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> <script src="/js/highlight.pack.js"></script> <script>hljs.highlightAll();</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10