Что-то вы гоните насчет "привычного вида формата 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
🌙#Hashtag’chilarim, ulugʻ ayyom - Qurbon hayiti muborak!
🐑 Keltirilayotgan qurbonliklar dargohida qabul boʻlsin.
✈️ Eng yaxshi tilaklar va albatta, eng yangi gadjetlarni tilab qolaman.
😎Hurmat bilan, JM!
Hammaga salom!
Ha, ancha yo'q bo'lib qoldim, postlar qo'yilmadi, ijod qilinmadi. Sabablar yetarlicha, afsuski.
Kuz fasli oilamiz uchun quvonarli kelib, o'g'il farzandli bo'lgandim. Kuz oxiriga kelib esa Otam bilan bog'liq kutilmagan fojea yuz berib, 29-oktyabrda reanimatsiyaga tushib qoldilar. Allohning irodasi ekan, 46 kunlik og'ir betoblikdan keyin Otam 14-dekabr kuni vafot etdilar...
Shu-shu, dafn marosimlari bilan ovora bo'lib, o'zimning sog'ligim va halovat yo'qligi bois kanalga yangilik joylashtira olmadim. Lekin, hayot davom etarkan. O'zimda kuch to'plab, sekin-asta ishga, ijodga qaytyapman. Shu sabab, sizning qo'llab-quvvatlab turishingiz zarur menga.
Rahmatli Otamni sizlarga keyinroq batafsil tanishtirmasam bo'lmaydi. Chunki ular #Hashtag blogimning qandaydir ma'noda asoschisi ham. 6 yoshligimdan qo'limga "payal'nik" berib, tranzistor-u diodlarni, kondensator va rezistorlarni tanishtirgan, birinchi radio, robotlarimni yasashni o'rgatgan aynan Otam - Bekpo'lat o'g'li Faxriddin!
Adamni ohirati obod bo'lsin, Jannatlarda uchrashish nasib etsin. Duolaringizda eslab qo'ysangiz, sizdan minnatdorman. 🤲🏻
⚠️ Endi 9/11 men uchun yomon sana emas!
🎉 Bu xursandchilikni sizlar bilan bo'lishgim keldi. Bugun oilamizda "kichkina #hashtag" dunyoga keldi, Alhamdulillah.
🤲 InshaAllah yurtimizga, dinimizga xizmat qiladigan o'g'il bo'lsin. "Ayti" bo'yicha bilimi kuchli, sportdayam tengsizlar qatorida bo'lib, O'zbekiston bayrog'ini yuqoriga ko'p marotaba ko'tarishini niyat qildim (orada bayrog'imizni Oyga, Marsga qo'yishini ham o'yladim, to'g'risi 😅)
☺️ Oldindan bildiriladigan tilaklar va tabriklar uchun rahmat, #Hashtag oilasi!
🏆 OKX Bounty Hunt New Season #2🏆
Engage, Refer & Win!
Prize:
- $400 USDT weekly allocation
🥇 $80 | 🥈 $60 | 🥉 $40
4th to 6th - $20
7th to 10th - $15
11th - 20th - $10
How to earn points:
✅ Check In Daily -> GM OKX Fam #OKXBountyHuntNewSeason#2 every day 👉50000
✅ Chat & Engage - Chat actively (30+ characters) 👉30
✅ Invite Friends - 🔗 Tag Admins to get your personal invite link and invite more people to join OKX Announcement👉50
✅ Share your reactions/emojis under the announcement posts
Check points🏆
Bounty points
Bounty ranking
More points!
👉 Share pictures and topics of New Year and crypto with the #hashtag in the chat
Join the event now👇👇👇
OKX Bounty Hunt New Season #2 Form
Our Socials:
⚜️Sign Up on OKX | Join Affiliate | TG | DC | Wallet TG | Wallet Announcement | OKX on Spotify | Twitter/X | YouTube
⭐️CN DC | CN TG
‼️Please check the authenticity of all OKX links or channels at OKX channel verification
🏆 OKX Bounty Hunt New Season #1🏆
Engage, Refer & Win!
Prize:
- $400 USDT weekly allocation
🥇 $100 | 🥈 $50 | 🥉 $30
4th to 6th - $20
7th to 10th - $15
11th - 20th - $10
How to earn points:
✅ Check In Daily -> GM OKX Fam #OKXBountyHuntNewSeason#1 every day 👉50000
✅ Chat & Engage - Chat actively (50+ characters) 👉20
✅ Invite Friends - 🔗 Tag Admins to get your personal invite link and invite more people to join OKX Announcement👉50
✅ Inviters earns extra 👉 10 per message sent by the invitee
✅ Share your reactions/emojis under the announcement posts
Check points🏆
Bounty Points
Bounty Ranking
More points!
👉 Share pictures and topics of New Year and crypto with the #hashtag in the chat
Join the event now👇👇👇
OKX Bounty Hunt New Season #1 Form
Our Socials:
⚜️Sign Up on OKX | Join Affiliate | TG | DC | Wallet TG | Wallet Announcement | OKX on Spotify | Twitter/X | YouTube
⭐️CN DC | CN TG
‼️Please check the authenticity of all OKX links or channels at OKX channel verification
Chat-Specific Hashtags. Groups and channels can use the new format#hashtag@username for hashtags – which only show posts and stories from the same chat when tapped.
October Features
1 • 2 • 3 • 4 • 5 • 6 • 7 • 8 • 9 • More