# File lib/listen/directory_record.rb, line 192 def relative_to_base(path) return nil unless path[directory] path = path.force_encoding("BINARY") if path.respond_to?(:force_encoding) path.sub(%r{^#{Regexp.quote(directory)}#{File::SEPARATOR}?}, '') end