Home
last modified time | relevance | path

Searched refs:st_mode (Results 1 – 25 of 584) sorted by relevance

12345678910>>...24

/third_party/python/Lib/test/
Dtest_stat.py93 st_mode = os.lstat(fname).st_mode
95 st_mode = os.stat(fname).st_mode
96 modestr = self.statmod.filemode(st_mode)
97 return st_mode, modestr
121 st_mode, modestr = self.get_mode()
123 self.assertS_IS("REG", st_mode)
124 self.assertEqual(self.statmod.S_IMODE(st_mode),
128 st_mode, modestr = self.get_mode()
130 self.assertS_IS("REG", st_mode)
131 self.assertEqual(self.statmod.S_IMODE(st_mode),
[all …]
/third_party/libuv/test/
Dtest-pipe-set-fchmod.c52 ASSERT(stat_buf.st_mode & S_IRUSR); in TEST_IMPL()
53 ASSERT(stat_buf.st_mode & S_IRGRP); in TEST_IMPL()
54 ASSERT(stat_buf.st_mode & S_IROTH); in TEST_IMPL()
61 ASSERT(stat_buf.st_mode & S_IWUSR); in TEST_IMPL()
62 ASSERT(stat_buf.st_mode & S_IWGRP); in TEST_IMPL()
63 ASSERT(stat_buf.st_mode & S_IWOTH); in TEST_IMPL()
70 ASSERT(stat_buf.st_mode & S_IRUSR); in TEST_IMPL()
71 ASSERT(stat_buf.st_mode & S_IRGRP); in TEST_IMPL()
72 ASSERT(stat_buf.st_mode & S_IROTH); in TEST_IMPL()
73 ASSERT(stat_buf.st_mode & S_IWUSR); in TEST_IMPL()
[all …]
/third_party/toybox/toys/other/
Dlsattr.c85 if(!S_ISREG(sb->st_mode) && !S_ISDIR(sb->st_mode)) { in ext2_getflag()
98 if (!stat(path, &sb) && !S_ISREG(sb.st_mode) && !S_ISDIR(sb.st_mode)) { in print_file_attr()
150 if (S_ISDIR(root->st.st_mode) && !root->parent) in retell_dir()
157 if (S_ISDIR(root->st.st_mode) && (toys.optflags & FLAG_R) in retell_dir()
176 else if (S_ISDIR(sb.st_mode) && !(toys.optflags & FLAG_d)) in lsattr_main()
195 if (!S_ISREG(sb->st_mode) && !S_ISDIR(sb->st_mode)) { in ext2_setflag()
264 if ((S_ISLNK(root->st.st_mode) && chattr.recursive) in update_attr()
265 || (!S_ISREG(root->st.st_mode) && !S_ISLNK(root->st.st_mode) in update_attr()
266 && !S_ISDIR(root->st.st_mode))) in update_attr()
287 if (!S_ISDIR(root->st.st_mode)) fval &= ~FS_DIRSYNC_FL; in update_attr()
[all …]
Dswitch_root.c34 if (S_ISDIR(node->st.st_mode)) {
76 if (stat(*cmdline, &st1) || !S_ISREG(st1.st_mode) || !(st1.st_mode&0100)) { in switch_root_main()
Dstat.c78 if (type == 'a') out('o', stat->st_mode&~S_IFMT); in print_stat()
82 mode_to_string(stat->st_mode, str); in print_stat()
93 else if (type == 'f') out('x', stat->st_mode); in print_stat()
97 int i, filetype = stat->st_mode & S_IFMT; in print_stat()
118 if (S_ISLNK(stat->st_mode)) in print_stat()
/third_party/toybox/porting/liteos_a/toys/posix/
Dcp.c121 if (S_ISDIR(try->st.st_mode) && try->again) { in cp_node()
127 if (S_ISLNK(try->st.st_mode) && (flags & FLAG_d)) flags |= FLAG_r; in cp_node()
133 if (!faccessat(cfd, catch, F_OK, 0) && !S_ISDIR(cst.st_mode)) { in cp_node()
136 if (S_ISDIR(try->st.st_mode)) { in cp_node()
165 if (S_ISDIR(try->st.st_mode)) { in cp_node()
181 if (!mkdirat(cfd, catch, try->st.st_mode | 0200) || errno == EEXIST) in cp_node()
183 if (!fstat(try->extra, &st2) && S_ISDIR(st2.st_mode)) in cp_node()
219 } else if (!S_ISREG(try->st.st_mode) in cp_node()
225 if (S_ISLNK(try->st.st_mode) in cp_node()
229 : !mknodat(cfd, catch, try->st.st_mode, try->st.st_rdev)) in cp_node()
[all …]
Drm.c36 if (S_ISREG(stat_info.st_mode) || S_ISLNK(stat_info.st_mode)) { in toybox_cmd_do_rmdir()
75 int fd=dirtree_parentfd(try), dir=S_ISDIR(try->st.st_mode), or=0; in do_rm()
89 && (!S_ISLNK(try->st.st_mode) && faccessat(fd, try->name, W_OK, 0))) or++; in do_rm()
/third_party/toybox/toys/posix/
Dcp.c137 if (S_ISDIR(try->st.st_mode) && try->again) { in cp_node()
143 if (S_ISLNK(try->st.st_mode) && (flags & FLAG_d)) flags |= FLAG_r; in cp_node()
160 if (!faccessat(cfd, catch, F_OK, 0) && !S_ISDIR(cst.st_mode)) { in cp_node()
163 if (S_ISDIR(try->st.st_mode)) { in cp_node()
192 if (S_ISDIR(try->st.st_mode)) { in cp_node()
208 if (!mkdirat(cfd, catch, try->st.st_mode | 0200) || errno == EEXIST) in cp_node()
210 if (!fstat(try->extra, &st2) && S_ISDIR(st2.st_mode)) in cp_node()
246 } else if (!S_ISREG(try->st.st_mode) in cp_node()
252 if (S_ISLNK(try->st.st_mode) in cp_node()
256 : !mknodat(cfd, catch, try->st.st_mode, try->st.st_rdev)) in cp_node()
[all …]
Dcpio.c197 if (fd != -1 && !fstat(fd, &st) && (st.st_mode&S_IFMT) == (mode&S_IFMT)) in cpio_main()
233 if (lstat(name, &st) || (S_ISREG(st.st_mode) in cpio_main()
240 if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) st.st_size = 0; in cpio_main()
245 (int)st.st_ino, st.st_mode, st.st_uid, st.st_gid, (int)st.st_nlink, in cpio_main()
258 if (S_ISLNK(st.st_mode)) { in cpio_main()
Dln.c48 i = S_ISDIR(buf.st_mode);
52 } else buf.st_mode = 0;
58 if (S_ISDIR(buf.st_mode)) new = xmprintf("%s/%s", dest, basename(try));
/third_party/ltp/testcases/kernel/syscalls/dup/
Ddup07.c70 if (retbuf.st_mode != dupbuf.st_mode) { in main()
92 if (retbuf.st_mode != dupbuf.st_mode) { in main()
115 if (retbuf.st_mode != dupbuf.st_mode) { in main()
/third_party/ltp/testcases/kernel/syscalls/dup2/
Ddup202.c100 if (oldbuf.st_mode != newbuf.st_mode) in run()
102 oldbuf.st_mode, newbuf.st_mode); in run()
105 oldbuf.st_mode, newbuf.st_mode); in run()
/third_party/ffmpeg/libavformat/
Dfile.c163 ret |= st.st_mode&S_IRUSR ? mask&AVIO_FLAG_READ : 0; in file_check()
164 ret |= st.st_mode&S_IWUSR ? mask&AVIO_FLAG_WRITE : 0; in file_check()
236 h->is_streamed = !fstat(fd, &st) && S_ISFIFO(st.st_mode); in file_open()
258 return ret < 0 ? AVERROR(errno) : (S_ISFIFO(st.st_mode) ? 0 : st.st_size); in file_seek()
310 if (S_ISDIR(st.st_mode)) in file_read_dir()
312 else if (S_ISFIFO(st.st_mode)) in file_read_dir()
314 else if (S_ISCHR(st.st_mode)) in file_read_dir()
316 else if (S_ISBLK(st.st_mode)) in file_read_dir()
318 else if (S_ISLNK(st.st_mode)) in file_read_dir()
320 else if (S_ISSOCK(st.st_mode)) in file_read_dir()
[all …]
/third_party/ltp/testcases/kernel/syscalls/chmod/
Dchmod01.c44 stat_buf.st_mode &= ~tc->mode_mask; in verify_chmod()
46 if (stat_buf.st_mode == (unsigned int)mode) { in verify_chmod()
48 tc->name, stat_buf.st_mode); in verify_chmod()
51 tc->name, stat_buf.st_mode); in verify_chmod()
Dchmod03.c50 if ((stat_buf.st_mode & PERMS) != PERMS) { in verify_chmod()
52 tc->name, stat_buf.st_mode); in verify_chmod()
55 tc->name, stat_buf.st_mode); in verify_chmod()
/third_party/boost/boost/process/detail/posix/
Dhandles.hpp78 …return S_ISCHR (stat_.st_mode) //This macro returns non-zero if the file is a character special … in is_stream_handle()
79 …|| S_ISBLK (stat_.st_mode) // This macro returns non-zero if the file is a block special file (a … in is_stream_handle()
80 || S_ISREG (stat_.st_mode) // This macro returns non-zero if the file is a regular file. in is_stream_handle()
81 …|| S_ISFIFO (stat_.st_mode) // This macro returns non-zero if the file is a FIFO special file, or … in is_stream_handle()
82 …|| S_ISSOCK (stat_.st_mode) ;// This macro returns non-zero if the file is a socket. See section 1… in is_stream_handle()
/third_party/e2fsprogs/lib/e2p/
Dfsetflags.c87 !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) { in fsetflags()
98 !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) { in fsetflags()
Dfgetflags.c86 !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) { in fgetflags()
97 !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) { in fgetflags()
/third_party/lz4/programs/
Dutil.h132 # define UTIL_STAT_MODE_ISREG(st_mode) ((st_mode) & S_IFREG) argument
137 # define UTIL_STAT_MODE_ISREG(st_mode) ((st_mode) & S_IFREG) argument
142 # define UTIL_STAT_MODE_ISREG(st_mode) (S_ISREG(st_mode)) argument
347 res += chmod(filename, statbuf->st_mode & 07777); /* Copy file permissions */ in UTIL_setFileStat()
359 if (r || !(statbuf->st_mode & S_IFREG)) return 0; /* No good... */ in UTIL_getFileStat()
362 if (r || !S_ISREG(statbuf->st_mode)) return 0; /* No good... */ in UTIL_getFileStat()
381 if (!r && (statbuf.st_mode & _S_IFDIR)) return 1; in UTIL_isDirectory()
384 if (!r && S_ISDIR(statbuf.st_mode)) return 1; in UTIL_isDirectory()
402 if (r || !UTIL_STAT_MODE_ISREG(statbuf.st_mode)) return 0; /* No good... */ in UTIL_getOpenFileSize()
413 if (r || !UTIL_STAT_MODE_ISREG(statbuf.st_mode)) return 0; /* No good... */ in UTIL_getFileSize()
/third_party/f2fs-tools/fsck/
Dsload.c152 if (S_ISREG(stat.st_mode)) { in set_inode_metadata()
154 } else if (S_ISDIR(stat.st_mode)) { in set_inode_metadata()
156 } else if (S_ISCHR(stat.st_mode)) { in set_inode_metadata()
158 } else if (S_ISBLK(stat.st_mode)) { in set_inode_metadata()
160 } else if (S_ISFIFO(stat.st_mode)) { in set_inode_metadata()
162 } else if (S_ISSOCK(stat.st_mode)) { in set_inode_metadata()
164 } else if (S_ISLNK(stat.st_mode)) { in set_inode_metadata()
176 de->mode = stat.st_mode & in set_inode_metadata()
/third_party/eudev/src/shared/
Dmkdir.c42 if ((st.st_mode & 0007) > (mode & 0007) || in mkdir_safe_internal()
43 (st.st_mode & 0070) > (mode & 0070) || in mkdir_safe_internal()
44 (st.st_mode & 0700) > (mode & 0700) || in mkdir_safe_internal()
47 !S_ISDIR(st.st_mode)) in mkdir_safe_internal()
/third_party/boost/libs/filesystem/src/
Doperations.cpp217 || ::mkdir(to.c_str(),from_stat.st_mode)!= 0))
1170 if (BOOST_UNLIKELY(!S_ISREG(from_stat.st_mode))) in copy_file()
1178 mode_t to_mode = from_stat.st_mode | S_IWUSR; in copy_file()
1236 if (BOOST_UNLIKELY(!S_ISREG(to_stat.st_mode))) in copy_file()
1271 if (to_stat.st_mode != from_stat.st_mode) in copy_file()
1273 if (BOOST_UNLIKELY(::fchmod(outfile.fd, from_stat.st_mode) != 0)) in copy_file()
1434 if (!S_ISDIR(existing_stat.st_mode)) in create_directory()
1440 mode = existing_stat.st_mode; in create_directory()
1705 if (error(!S_ISREG(path_stat.st_mode) ? EPERM : 0, in file_size()
1778 return S_ISDIR(path_stat.st_mode) in is_empty()
[all …]
/third_party/toybox/toys/pending/
Ddiff.c504 if (S_ISDIR(node->st.st_mode) && !node->parent) { //add root dirs. in list_dir()
509 if (S_ISDIR(node->st.st_mode) && (toys.optflags & FLAG_r)) { in list_dir()
518 return S_ISDIR(node->st.st_mode) ? 0 : (DIRTREE_RECURSE|DIRTREE_SYMFOLLOW); in list_dir()
759 if (S_ISDIR(st[0].st_mode) && S_ISDIR(st[1].st_mode)) in create_empty_entry()
761 else if (!S_ISREG(st[0].st_mode) && !S_ISDIR(st[0].st_mode)) in create_empty_entry()
764 else if (!S_ISREG(st[1].st_mode) && !S_ISDIR(st[1].st_mode)) in create_empty_entry()
767 else if (S_ISDIR(st[0].st_mode) != S_ISDIR(st[1].st_mode)) { in create_empty_entry()
768 if (S_ISDIR(st[0].st_mode)) in create_empty_entry()
866 && (S_ISDIR(TT.st[0].st_mode) || S_ISDIR(TT.st[1].st_mode))) in diff_main()
875 if (S_ISDIR(TT.st[0].st_mode) && S_ISDIR(TT.st[1].st_mode)) { in diff_main()
[all …]
/third_party/flutter/skia/third_party/externals/sdl/src/audio/
DSDL_audiodev.c53 if ((stat(fname, &sb) == 0) && (S_ISCHR(sb.st_mode))) { in test_device()
93 if (((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) in SDL_EnumUnixAudioDevices_Internal()
95 && S_ISCHR(sb.st_mode))) { in SDL_EnumUnixAudioDevices_Internal()
/third_party/ltp/testcases/kernel/fs/proc/
Dproc01.c267 if (S_ISLNK(statbuf.st_mode) && strcmp(obj, selfpath)) in readproc()
273 if (S_ISDIR(statbuf.st_mode) || !strcmp(obj, selfpath)) { in readproc()
338 if (!S_ISREG(statbuf.st_mode)) in readproc()
366 if ((statbuf.st_mode & S_IRUSR) == 0 && in readproc()
367 (statbuf.st_mode & S_IWUSR) != 0) { in readproc()

12345678910>>...24