Home | History | Annotate | Download | only in base

Lines Matching refs:pathname

59 void IOSAppName(rtc::Pathname* path);
92 bool UnixFilesystem::CreateFolder(const Pathname &path, mode_t mode) {
93 std::string pathname(path.pathname());
94 int len = pathname.length();
95 if ((len == 0) || (pathname[len - 1] != '/'))
99 int res = ::stat(pathname.c_str(), &st);
111 } while ((len > 0) && (pathname[len - 1] != '/'));
113 if (!CreateFolder(Pathname(pathname.substr(0, len)), mode)) {
117 LOG(LS_INFO) << "Creating folder: " << pathname;
118 return (0 == ::mkdir(pathname.c_str(), mode));
121 bool UnixFilesystem::CreateFolder(const Pathname &path) {
125 FileStream *UnixFilesystem::OpenFile(const Pathname &filename,
128 if (fs && !fs->Open(filename.pathname().c_str(), mode.c_str(), NULL)) {
135 bool UnixFilesystem::CreatePrivateFile(const Pathname &filename) {
136 int fd = open(filename.pathname().c_str(),
151 bool UnixFilesystem::DeleteFile(const Pathname &filename) {
152 LOG(LS_INFO) << "Deleting file:" << filename.pathname();
158 return ::unlink(filename.pathname().c_str()) == 0;
161 bool UnixFilesystem::DeleteEmptyFolder(const Pathname &folder) {
162 LOG(LS_INFO) << "Deleting folder" << folder.pathname();
168 std::string no_slash(folder.pathname(), 0, folder.pathname().length()-1);
172 bool UnixFilesystem::GetTemporaryFolder(Pathname &pathname, bool create,
182 pathname.SetPathname(reinterpret_cast<char*>(buffer), "");
185 pathname.SetPathname(provided_app_temp_folder_, "");
188 pathname.SetPathname(tmpdir, "");
190 pathname.SetPathname(tmp, "");
193 pathname.SetPathname(P_tmpdir, "");
195 pathname.SetPathname("/tmp/", "");
201 pathname.AppendFolder(*append);
203 return !create || CreateFolder(pathname);
206 std::string UnixFilesystem::TempFilename(const Pathname &dir,
208 int len = dir.pathname().size() + prefix.size() + 2 + 6;
211 snprintf(tempname, len, "%s/%sXXXXXX", dir.pathname().c_str(),
222 bool UnixFilesystem::MoveFile(const Pathname &old_path,
223 const Pathname &new_path) {
228 LOG(LS_VERBOSE) << "Moving " << old_path.pathname()
229 << " to " << new_path.pathname();
230 if (rename(old_path.pathname().c_str(), new_path.pathname().c_str()) != 0) {
241 bool UnixFilesystem::MoveFolder(const Pathname &old_path,
242 const Pathname &new_path) {
247 LOG(LS_VERBOSE) << "Moving " << old_path.pathname()
248 << " to " << new_path.pathname();
249 if (rename(old_path.pathname().c_str(), new_path.pathname().c_str()) != 0) {
260 bool UnixFilesystem::IsFolder(const Pathname &path) {
262 if (stat(path.pathname().c_str(), &st) < 0)
267 bool UnixFilesystem::CopyFile(const Pathname &old_path,
268 const Pathname &new_path) {
269 LOG(LS_VERBOSE) << "Copying " << old_path.pathname()
270 << " to " << new_path.pathname();
292 bool UnixFilesystem::IsTemporaryPath(const Pathname& pathname) {
308 if (0 == strncmp(pathname.pathname().c_str(), kTempPrefixes[i],
315 bool UnixFilesystem::IsFile(const Pathname& pathname) {
317 int res = ::stat(pathname.pathname().c_str(), &st);
322 bool UnixFilesystem::IsAbsent(const Pathname& pathname) {
324 int res = ::stat(pathname.pathname().c_str(), &st);
326 // that you could not call CreateFolder(pathname).
330 bool UnixFilesystem::GetFileSize(const Pathname& pathname, size_t *size) {
332 if (::stat(pathname.pathname().c_str(), &st) != 0)
338 bool UnixFilesystem::GetFileTime(const Pathname& path, FileTimeType which,
341 if (::stat(path.pathname().c_str(), &st) != 0)
359 bool UnixFilesystem::GetAppPathname(Pathname* path) {
390 bool UnixFilesystem::GetAppDataFolder(Pathname* path, bool per_user) {
468 if (0 != ::chmod(path->pathname().c_str(), 0700)) {
476 bool UnixFilesystem::GetAppTempFolder(Pathname* path) {
500 app_temp_path_ = CopyString(path->pathname());
506 bool UnixFilesystem::GetDiskFreeSpace(const Pathname& path,
515 Pathname existing_path(path.folder(), "");
522 if (0 != statfs(existing_path.pathname().c_str(), &vfs))
527 if (0 != statvfs(existing_path.pathname().c_str(), &vfs))
540 Pathname UnixFilesystem::GetCurrentDirectory() {
541 Pathname cwd;
547 return cwd; // returns empty pathname