Lines Matching refs:path
329 /// @param path the path to the function to stat.
335 get_stat(const string& path,
337 {return (lstat(path.c_str(), s) == 0);}
339 /// Tests whether a path exists;
341 /// @param path the path to test for.
343 /// @return true iff the path at @p path exist.
345 file_exists(const string& path)
349 return get_stat(path, &st);
354 /// @param path the path of the directory to consider.
356 /// @return true iff a directory exists with the name @p path
358 dir_exists(const string &path)
359 {return file_exists(path) && is_dir(path);}
363 /// @param path the path of the directory to consider
365 dir_is_empty(const string &path)
367 if (!dir_exists(path))
370 DIR* dir = opendir(path.c_str());
384 /// Test if path is a path to a regular file or a symbolic link to a
387 /// @param path the path to consider.
389 /// @return true iff path is a regular path.
391 is_regular_file(const string& path)
395 if (!get_stat(path, &st))
402 if (maybe_get_symlink_target_file_path(path, symlink_target_path))
429 /// @param elf_file_path the path to the ELF file to consider.
465 /// @param elf_file_path the path to the ELF file to consider.
500 for (const auto& path : debug_info_root_paths)
501 if (dir_contains_ctf_archive(*path, vmlinux))
507 /// Tests if a given path is a directory or a symbolic link to a
510 /// @param path the path to test for.
512 /// @return true iff @p path is a directory.
514 is_dir(const string& path)
518 if (!get_stat(path, &st))
525 if (maybe_get_symlink_target_file_path(path, symlink_target_path))
641 /// path to the target file.
643 /// @param file_path the path to the file to consider.
646 /// canonicalized path to the target file, if @p file_path is a
651 /// path of the target file.
673 /// Return the directory part of a file path.
675 /// @param path the file path to consider
687 dir_name(string const& path,
691 if (path.empty())
697 char *p = strdup(path.c_str());
702 && dir_name.length() < path.length())
709 /// @param path the file path to consider.
716 base_name(string const &path,
719 if (path.empty())
725 char *p = strdup(path.c_str());
732 /// Return the real path of a given path.
734 /// The real path of path 'foo_path' is the same path as foo_path, but
737 /// @param path the path to consider.
741 real_path(const string&path, string& result)
743 if (path.empty())
749 char *realp = realpath(path.c_str(), NULL);
788 /// Ensures that the parent directory of #path is created.
790 /// \return true if the parent directory of #path is already present,
793 ensure_parent_dir_created(const string& path)
797 if (path.empty())
801 if (dir_name(path, parent))
826 /// Check if a given path exists and is readable.
828 /// @param path the path to consider.
832 /// @return true iff path exists and is readable.
834 check_file(const string& path, ostream& out, const string& prog_name)
836 if (!file_exists(path))
838 emit_prefix(prog_name, out) << "file " << path << " does not exist\n";
842 if (!is_regular_file(path))
844 emit_prefix(prog_name, out) << path << " is not a regular file\n";
851 /// Check if a given path exists, is readable and is a directory.
853 /// @param path the path to consider.
860 /// @return true iff @p path exists and is for a directory.
862 check_dir(const string& path, ostream& out, const string& prog_name)
864 if (!file_exists(path))
866 emit_prefix(prog_name, out) << "path " << path << " does not exist\n";
870 if (!is_dir(path))
872 emit_prefix(prog_name, out) << path << " is not a directory\n";
1203 /// @param rpm_path the path to the RPM to consider.
1353 /// Return the path to the temporary file.
1355 /// @return the path to the temporary file if it's usable, otherwise
1584 /// @param file_path the path to the file to consider.
1805 /// Return a copy of the path given in argument, turning it into an
1806 /// absolute path by prefixing it with the concatenation of the result
1813 /// @param p the path to turn into an absolute path.
1815 /// @return a shared pointer to the resulting absolute path.
1836 /// Return a copy of the path given in argument, turning it into an
1837 /// absolute path by prefixing it with the concatenation of the result
1843 /// @param p the path to turn into an absolute path.
1845 /// @return a pointer to the resulting absolute path. It must be
1871 /// @param file_path the path to the file that defines types that are
1873 /// in other files are to be suppressed. Note that this file path is
2151 /// Get the path to the default system suppression file.
2170 /// Get the path to the default user suppression file.
2232 /// @param fname the file name (or end of path) to consider.
2234 /// @return true iff @p entry denotes a file which path ends with @p
2253 /// path.
2260 /// @param result the resulting path to @p file_path_to_look_for.
2301 /// suppression specification path.
2392 /// @param vmlinux_path output parameter. This is set to the path
2405 char* path[] = {const_cast<char*>(from.c_str()), 0};
2407 FTS *file_hierarchy = fts_open(path, FTS_PHYSICAL|FTS_NOCHDIR|FTS_XDEV, 0);
2447 char* path[] = {const_cast<char*>(from.c_str()), 0};
2449 FTS *file_hierarchy = fts_open(path, FTS_PHYSICAL|FTS_NOCHDIR|FTS_XDEV, 0);
2482 /// @param debug_info_root_path the path to the directory under which
2485 /// @param vmlinux_path output parameter. The path of the vmlinux
2492 /// @return true if at least the path to the vmlinux binary was found.
2534 /// Get the path of the vmlinux binary under the given directory, that
2539 /// @param vmlinux_path output parameter. The path of the vmlinux
2542 /// @return true if the path to the vmlinux binary was found.
2572 /// @param vmlinux_path output parameter. The path of the vmlinux
2578 /// @return true if at least the path to the vmlinux binary was found.
2601 /// @param vmlinux the path to the vmlinux binary.
2606 /// @param root the path of the directory under which the kernel
2609 /// @param di_root the directory in aboslute path which debug
2717 /// @param root the path of the directory under which the kernel
2719 /// somewhere under that directory, but if it's not in there, its path
2725 /// @param vmlinux_path the path to the vmlinux binary, if that binary
2818 /// @param elf_file_path a path to the ELF file to consider