Что-то вы гоните насчет "привычного вида формата 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
🎡 Supreme Spin is about to get even better! 🚀
A new update is coming with bigger rewards 🎁 and an exciting twist: soon, you can use $SING to spin and win! 💎
This is your moment to shine — hold your $SING tight and get ready to aim for the top! Massive prizes await those who are prepared. 🔥
Stay tuned for more details coming soon. Let the spinning madness begin! 🎉
👉#SingSingTycoon#SupremeSpin#SingSingSDK
🚨 Exciting News!🚨
🎉The 1st RUBY Halving event is COMING!
🗓Halving Date: TBA
RUBY plays a crucial role in the SingSing ecosystem. As we progress, our halving events will strategically decrease RUBY supply, rewarding early supporters of the project.
👉 What to expect:
1️⃣50% reduction in RUBY emissions (after Halving point).
2️⃣Increased scarcity, leading to potential value growth.
3️⃣Enhanced economic stability within the SingSing ecosystem.
Prepare for the change and maximize your RUBY holdings! 🌟
#RUBYHalving#SingSingSDK#Event
🎉 Supreme Spin is officially LIVE!
🔥 Get ready for massive rewards and a shot at winning TON right at your fingertips! 💎💰 Don’t miss out—spin now for a chance to grab these incredible prizes! 🎯
#SupremeSpin#TONRewards#SingSingSDK
🎤Announcement | Chat | X (Twitter) | Website | Game
We're thrilled to unveil our latest innovation that's set to revolutionize the Telegram mini-app ecosystem - SingSing SocialFi SDK.
🛠 Our Developer-Friendly SDK brings powerful social and financial features to developers and users alike with:
✅Seamlessly integrate SingSing's features into your Telegram mini-apps
✅Enhance user engagement and monetization opportunities
✅Leverage SingSing club system
✅Use SingSing payment system
🔒 Our SDK is currently being refined with our early partners to ensure a seamless experience. Stay tuned for the public release!
Read more and open treasure at: X Post
#SingSingSDK#TelegramMiniApps#Web3Gaming#SocialFi
🎉 Exciting Partnership Announcement
We're thrilled to introduce our first official partner for the SingSing SocialFi SDK: Cowtopia🐮!
Cowtopia, an innovative farming simulation game, will be the first to integrate our powerful SocialFi SDK. This collaboration marks a significant milestone as we prepare to revolutionize the Telegram mini-app ecosystem.
Stay tuned and see how Cowtopia will utilize our SDK to create an immersive and socially connected gaming experience.
Read more and open treasure at: X Post
#SingSingSDK#Cowtopia#TelegramGaming#SocialFi#FarmingSimulator#ComingSoon