Greetings Monks,
Using Perl v5.36.0 on macOS configured with defaults.
I would like to use the macOS specific F_NOCACHE flag when opening a filehandle. For example:
use Fcntl; sysopen(my $FI, "testFile.txt", O_RDONLY | F_NOCACHE ) or die "Could not open 'testFile.txt' $!";
However, Fcntl.pm does not export F_NOCACHE even though it is defined in my fcntl.h:
#define F_NOCACHE 48 /* turn data caching off/on for this fd */Is there a configuration option to build perl with a Fcntl perl module that supports the F_NOCACHE flag to sysopen? Or is there another way to pass this flag through sysopen?
I am opening numerous large files that do not need to stay in memory, so the macOS file cache quickly fills up with files that will not be referenced again. Not that big a deal but macOS will drop other files from the file cache as my script is running, and those other files would be better off staying in memory.
Also, in benchmarking scenarios, I would rather read files from disk.
Thanks for any info!In reply to macOS Fcntl.pm missing F_NOCACHE by bernuli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |