Lines Matching full:pathname
75 void IOSAppName(talk_base::Pathname* path);
108 bool UnixFilesystem::CreateFolder(const Pathname &path, mode_t mode) {
109 std::string pathname(path.pathname());
110 int len = pathname.length();
111 if ((len == 0) || (pathname[len - 1] != '/'))
115 int res = ::stat(pathname.c_str(), &st);
127 } while ((len > 0) && (pathname[len - 1] != '/'));
129 if (!CreateFolder(Pathname(pathname.substr(0, len)), mode)) {
133 LOG(LS_INFO) << "Creating folder: " << pathname;
134 return (0 == ::mkdir(pathname.c_str(), mode));
137 bool UnixFilesystem::CreateFolder(const Pathname &path) {
141 FileStream *UnixFilesystem::OpenFile(const Pathname &filename,
144 if (fs && !fs->Open(filename.pathname().c_str(), mode.c_str(), NULL)) {
151 bool UnixFilesystem::CreatePrivateFile(const Pathname &filename) {
152 int fd = open(filename.pathname().c_str(),
167 bool UnixFilesystem::DeleteFile(const Pathname &filename) {
168 LOG(LS_INFO) << "Deleting file:" << filename.pathname();
174 return ::unlink(filename.pathname().c_str()) == 0;
177 bool UnixFilesystem::DeleteEmptyFolder(const Pathname &folder) {
178 LOG(LS_INFO) << "Deleting folder" << folder.pathname();
184 std::string no_slash(folder.pathname(), 0, folder.pathname().length()-1);
188 bool UnixFilesystem::GetTemporaryFolder(Pathname &pathname, bool create,
198 pathname.SetPathname(reinterpret_cast<char*>(buffer), "");
201 pathname.SetPathname(provided_app_temp_folder_, "");
204 pathname.SetPathname(tmpdir, "");
206 pathname.SetPathname(tmp, "");
209 pathname.SetPathname(P_tmpdir, "");
211 pathname.SetPathname("/tmp/", "");
217 pathname.AppendFolder(*append);
219 return !create || CreateFolder(pathname);
222 std::string UnixFilesystem::TempFilename(const Pathname &dir,
224 int len = dir.pathname().size() + prefix.size() + 2 + 6;
227 snprintf(tempname, len, "%s/%sXXXXXX", dir.pathname().c_str(),
238 bool UnixFilesystem::MoveFile(const Pathname &old_path,
239 const Pathname &new_path) {
244 LOG(LS_VERBOSE) << "Moving " << old_path.pathname()
245 << " to " << new_path.pathname();
246 if (rename(old_path.pathname().c_str(), new_path.pathname().c_str()) != 0) {
257 bool UnixFilesystem::MoveFolder(const Pathname &old_path,
258 const Pathname &new_path) {
263 LOG(LS_VERBOSE) << "Moving " << old_path.pathname()
264 << " to " << new_path.pathname();
265 if (rename(old_path.pathname().c_str(), new_path.pathname().c_str()) != 0) {
276 bool UnixFilesystem::IsFolder(const Pathname &path) {
278 if (stat(path.pathname().c_str(), &st) < 0)
283 bool UnixFilesystem::CopyFile(const Pathname &old_path,
284 const Pathname &new_path) {
285 LOG(LS_VERBOSE) << "Copying " << old_path.pathname()
286 << " to " << new_path.pathname();
308 bool UnixFilesystem::IsTemporaryPath(const Pathname& pathname) {
324 if (0 == strncmp(pathname.pathname().c_str(), kTempPrefixes[i],
331 bool UnixFilesystem::IsFile(const Pathname& pathname) {
333 int res = ::stat(pathname.pathname().c_str(), &st);
338 bool UnixFilesystem::IsAbsent(const Pathname& pathname) {
340 int res = ::stat(pathname.pathname().c_str(), &st);
342 // that you could not call CreateFolder(pathname).
346 bool UnixFilesystem::GetFileSize(const Pathname& pathname, size_t *size) {
348 if (::stat(pathname.pathname().c_str(), &st) != 0)
354 bool UnixFilesystem::GetFileTime(const Pathname& path, FileTimeType which,
357 if (::stat(path.pathname().c_str(), &st) != 0)
375 bool UnixFilesystem::GetAppPathname(Pathname* path) {
406 bool UnixFilesystem::GetAppDataFolder(Pathname* path, bool per_user) {
484 if (0 != ::chmod(path->pathname().c_str(), 0700)) {
492 bool UnixFilesystem::GetAppTempFolder(Pathname* path) {
516 app_temp_path_ = CopyString(path->pathname());
522 bool UnixFilesystem::GetDiskFreeSpace(const Pathname& path, int64 *freebytes) {
530 Pathname existing_path(path.folder(), "");
537 if (0 != statfs(existing_path.pathname().c_str(), &vfs))
542 if (0 != statvfs(existing_path.pathname().c_str(), &vfs))
555 Pathname UnixFilesystem::GetCurrentDirectory() {
556 Pathname cwd;
562 return cwd; // returns empty pathname