You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because the directory cannot have nodes added to it, but the nodes are still writeable.
perl -MCarp::Always -MPath::Tiny=path -E 'path(q[/sys/devices/system/cpu/intel_pstate/max_perf_pct])->spew(100)'#Error sysopen on '/sys/devices/system/cpu/intel_pstate/max_perf_pct0831895': #Permission denied at /usr/lib64/perl5/vendor_perl/5.18.2/Path/Tiny.pm line 773.# Path::Tiny::Error::throw('Path::Tiny::Error', 'sysopen', '/sys/devices/system/cpu/intel_pstate/max_perf_pct0831895', 'Permission denied') called at /usr/lib64/perl5/vendor_perl/5.18.2/Path/Tiny.pm line 96# Path::Tiny::_throw('Path::Tiny=ARRAY(0x1602588)', 'sysopen') called at /usr/lib64/perl5/vendor_perl/5.18.2/Path/Tiny.pm line 376# Path::Tiny::filehandle('Path::Tiny=ARRAY(0x1602588)', 'HASH(0x15ef0e8)', '>', undef) called at /usr/lib64/perl5/vendor_perl/5.18.2/Path/Tiny.pm line 696# Path::Tiny::spew('Path::Tiny=ARRAY(0x1602498)', 100) called at -e line 1echo 100 > /sys/devices/system/cpu/intel_pstate/max_perf_pct
echo$?#0
The same is the case with files that are writable in directories that are not:
ls -lah
# total 204K# drwxr-xr-x 2 root root 4.0K Apr 4 03:15 .# drwxrwxrwt 20 root root 196K Apr 4 03:15 ..# -rw-r--r-- 1 kent kent 0 Apr 4 03:15 bar
perl -MPath::Tiny -E'path(q[./bar])->spew(q[hello])'# Error sysopen on 'bar8321321244076350': Permission denied at -e line 1.echo world > bar
echo$?#0
cat bar
# world
The text was updated successfully, but these errors were encountered:
That's by design and documented. Without that, an atomic write can't be guaranteed. If you need to write to such a file, you have to do it the old fashioned way and open a handle.
This is because the directory cannot have nodes added to it, but the nodes are still writeable.
The same is the case with files that are writable in directories that are not:
The text was updated successfully, but these errors were encountered: