bernuli has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: macOS Fcntl.pm missing F_NOCACHE
by kcott (Archbishop) on Oct 10, 2022 at 01:51 UTC | |
by bernuli (Novice) on Oct 10, 2022 at 06:04 UTC | |
by kcott (Archbishop) on Oct 10, 2022 at 22:57 UTC | |
|
Re: macOS Fcntl.pm missing F_NOCACHE
by hv (Prior) on Oct 10, 2022 at 01:56 UTC | |
by kcott (Archbishop) on Oct 10, 2022 at 02:35 UTC | |
by hv (Prior) on Oct 10, 2022 at 13:07 UTC | |
by Anonymous Monk on Oct 10, 2022 at 14:21 UTC | |
|
Re: macOS Fcntl.pm missing F_NOCACHE
by Bod (Parson) on Oct 09, 2022 at 22:17 UTC | |
by bernuli (Novice) on Oct 09, 2022 at 23:59 UTC |