MCPcopy Index your code
hub / github.com/RustPython/RustPython / attributes_to_mode

Function attributes_to_mode

crates/common/src/fileutils.rs:245–258  ·  view source on GitHub ↗
(attr: u32)

Source from the content-addressed store, hash-verified

243 }
244
245 const fn attributes_to_mode(attr: u32) -> u16 {
246 let mut m = 0;
247 if attr & FILE_ATTRIBUTE_DIRECTORY != 0 {
248 m |= libc::S_IFDIR | 0o111; // IFEXEC for user,group,other
249 } else {
250 m |= libc::S_IFREG;
251 }
252 if attr & FILE_ATTRIBUTE_READONLY != 0 {
253 m |= 0o444;
254 } else {
255 m |= 0o666;
256 }
257 m as _
258 }
259
260 #[derive(Clone, Copy)]
261 #[repr(C)]

Callers 2

attribute_data_to_statFunction · 0.70
stat_basic_info_to_statFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected