… | |
… | |
1079 | Scans a directory (similar to C<aio_readdir>) but additionally tries to |
1079 | Scans a directory (similar to C<aio_readdir>) but additionally tries to |
1080 | efficiently separate the entries of directory C<$path> into two sets of |
1080 | efficiently separate the entries of directory C<$path> into two sets of |
1081 | names, directories you can recurse into (directories), and ones you cannot |
1081 | names, directories you can recurse into (directories), and ones you cannot |
1082 | recurse into (everything else, including symlinks to directories). |
1082 | recurse into (everything else, including symlinks to directories). |
1083 | |
1083 | |
1084 | C<aio_scandir> is a composite request that creates of many sub requests_ |
1084 | C<aio_scandir> is a composite request that generates many sub requests. |
1085 | C<$maxreq> specifies the maximum number of outstanding aio requests that |
1085 | C<$maxreq> specifies the maximum number of outstanding aio requests that |
1086 | this function generates. If it is C<< <= 0 >>, then a suitable default |
1086 | this function generates. If it is C<< <= 0 >>, then a suitable default |
1087 | will be chosen (currently 4). |
1087 | will be chosen (currently 4). |
1088 | |
1088 | |
1089 | On error, the callback is called without arguments, otherwise it receives |
1089 | On error, the callback is called without arguments, otherwise it receives |
… | |
… | |
1608 | There are some caveats: when directories get renamed (or deleted), the |
1608 | There are some caveats: when directories get renamed (or deleted), the |
1609 | pathname string doesn't change, so will point to the new directory (or |
1609 | pathname string doesn't change, so will point to the new directory (or |
1610 | nowhere at all), while the directory fd, if available on the system, |
1610 | nowhere at all), while the directory fd, if available on the system, |
1611 | will still point to the original directory. Most functions accepting a |
1611 | will still point to the original directory. Most functions accepting a |
1612 | pathname will use the directory fd on newer systems, and the string on |
1612 | pathname will use the directory fd on newer systems, and the string on |
1613 | older systems. Some functions (such as realpath) will always rely on the |
1613 | older systems. Some functions (such as C<aio_realpath>) will always rely on |
1614 | string form of the pathname. |
1614 | the string form of the pathname. |
1615 | |
1615 | |
1616 | So this functionality is mainly useful to get some protection against |
1616 | So this functionality is mainly useful to get some protection against |
1617 | C<chdir>, to easily get an absolute path out of a relative path for future |
1617 | C<chdir>, to easily get an absolute path out of a relative path for future |
1618 | reference, and to speed up doing many operations in the same directory |
1618 | reference, and to speed up doing many operations in the same directory |
1619 | (e.g. when stat'ing all files in a directory). |
1619 | (e.g. when stat'ing all files in a directory). |