Что-то вы гоните насчет "привычного вида формата 755 и 644". Я вот вообще не понял что это!😳
Действительно, что означают цифры которые мы получили в прошлом посте?
Это кодировка, заключающая в себе режимы доступа к файлу.
Подробней можно почитать в статье про chmod.
Там можно увидеть альтернативное обозначение того же самого с помощью символов r w x, что значит чтение, запись, исполнение.
Чтобы преобразовать восьмеричное число в такое обозначение в Python есть готовая функция
>>> stat.filemode(0o755)
'?rwxr-xr-x'
Мы видим 3 группы по 3 символа, дающие 3 типа доступа для 3 типов юзеров.
А что за знак вопроса в начале?
Давайте передадим в эту функцию необрезанное значение от os.stat
>>> stat.filemode(os.stat(path).st_mode)
'drwxr-xr-x'
Это данные, которые мы безжалостно обрезали в прошлый раз😼
Первый символ обозначает тип объекта. Это может быть файл (-), директория (d) или симлинк (l).
Вот простая схема данной кодировки
[1][3][3][3]
│ │ │ │
│ │ │ └──> Others Permissions
│ │ └─────> Group Permissions
│ └────────> Owner Permissions
└───────────> File Type
(разверните экран если вы с телефона)
Если вы попробуете получить пермишены для симлинка то получите пермишены для файла
>>> path = '.venv/bin/python3'
>>> stat.filemode(os.stat(path).st_mode)
'-rwxr-xr-x'
Чтобы получить свойства именно симлинка, нужно это явно указать
>>> stat.filemode(os.stat(path, follow_symlinks=False).st_mode)
'lrwxrwxrwx'
#tricks#basic
🪐 On the outskirts of our galaxy, astronomers have detected a mysterious radio signal from the direction of the dwarf galaxy Leo I, which sits about 820,000 light-years away. While this signal is not evidence of aliens, its unusual features have made Leo I a target for SETI (Search for Extraterrestrial Intelligence) researchers who are carefully studying its properties to rule out natural sources—demonstrating how real cosmic signals from known galaxies push the boundaries of the scientific search for life beyond Earth. ✨
#aliens⚡#SETI⚡#galaxies⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 In 2017, astronomers detected a possible candidate for an extraterrestrial signal known as BLC1 from the direction of Proxima Centauri, the closest star system to our Sun. Follow-up studies showed the signal was likely human-made interference, but the discovery led to months of careful investigation and demonstrated how scientists search for alien technology by sifting through real, named stars for artificial-looking radio waves. ✨
#aliens⚡#SETI⚡#exoplanets⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 In 2020, astronomers using the Breakthrough Listen initiative scanned 1327 nearby stars up to 160 light-years away—including known exoplanet systems like Epsilon Eridani and Tau Ceti—for artificial radio signals that could hint at advanced alien technology. Although the search revealed over 9 million candidate signals, all were traced back to Earth-made sources, highlighting both the challenge and the rigor of the scientific hunt for extraterrestrial intelligence. ✨
#aliens⚡#exoplanets⚡#SETI⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 Scientists at the SETI Institute used the MeerKAT radio telescope in South Africa to scan the star system HD 164595, located about 94 light-years from Earth, after an unexplained radio signal was detected there in 2016. While no follow-up signals were found and natural or human-made origins are possible, the search highlights how carefully astronomers investigate even the faintest hints of possible alien technology from real, named stars in our galaxy. ✨
#aliens⚡#SETI⚡#radio⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
🪐 Between 1960 and 1998, the Arecibo radio telescope in Puerto Rico transmitted several powerful messages toward star clusters like M13 in the hope that intelligent aliens, if they exist, might detect and respond. These "active SETI" attempts used coded radio signals aimed at real star systems—making the search for extraterrestrial life not just a matter of listening, but also of sending greetings out into the galaxy with real, named astronomical targets. ✨
#aliens⚡#SETI⚡#radioastronomy⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The SETI Institute's ongoing Breakthrough Listen project regularly targets the region around the star Proxima Centauri—our solar system’s closest neighbor—searching for unusual radio signals that could hint at alien technology. By scanning billions of radio frequencies from Proxima Centauri and other nearby stars, scientists are using real astronomy to explore whether advanced extraterrestrial civilizations might exist within our interstellar neighborhood. ✨
#aliens⚡#ProximaCentauri⚡#SETI⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 The SETI Institute regularly scans the region near the star Ross 128, about 11 light-years away, after unusual radio signals were detected from its direction in 2017. Although those signals were later traced to Earth-based interference, the careful monitoring of Ross 128 shows how scientists use real stars as targets in the ongoing search for signs of life beyond our solar system. ✨
#aliens⚡#SETI⚡#Ross128⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels
🪐 One of the most famous searches for alien life involves listening for signals from the direction of Tabby’s Star (KIC 8462852), a real star in the constellation Cygnus known for its strange, unpredictable dips in brightness. Scientists at the SETI Institute have pointed sensitive radio telescopes at Tabby’s Star, searching for artificial signals that could suggest advanced technology, but so far, no evidence of extraterrestrial messages has been found—leaving the nature of the star’s odd behavior a true cosmic mystery. ✨
#aliens⚡#SETI⚡#Tabby⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space
👉subscribe Universe Mysteries
👉more Channels