End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
File::Stat#sticky?
stat.sticky? → true or false
file.c
View on GitHub ↗
static VALUE
rb_stat_sticky(VALUE obj)
{
#ifdef S_ISVTX
if (get_stat(obj)->st_mode & S_ISVTX) return Qtrue;
#endif
return Qfalse;
}
Returns true if stat has its sticky bit set, false if it doesn’t or if the operating system doesn’t support this feature.
Example
File.stat("testfile").sticky? #=> false