Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Pathname#mountpoint?
() -> bool
mountpoint? → true or false
pathname_builtin.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/pathname_builtin.rb, line 725
def mountpoint?
begin
stat1 = self.lstat
stat2 = self.parent.lstat
stat1.dev != stat2.dev || stat1.ino == stat2.ino
rescue Errno::ENOENT
false
end
end
Returns whether entry at the path in self is a mountpoint:
Example
Pathname('/').mountpoint? # => true Pathname('/etc').mountpoint? # => false Pathname('nosuch').mountpoint? # => false