Что-то вы гоните насчет "привычного вида формата 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
Upcoming Airdrops Alert! 🚀
Hey everyone! 🎉 If you missed out on the Dogs airdrop, don’t worry! There are some exciting new airdrops coming up that you won’t want to miss. Check out these potential big earners:
1. Major🌟
1. X Empire 🏰
3. Cats🐈
4. Memefi🎭
-Confirmed Listing Date: October 9th
-All WILL BE LISTED IN ABOUT A MONTH TIME , SO JOIN AND GET FREE TOKENS BEFORE ITS TOO LATE!!!
#Airdrops
🎁 The #giveaway with 4EVERLAND has officially ended! A big thank you to #TokenPocket for their support and to all participants.
👇🏻Keep an eye out for upcoming thrilling #airdrops and don't forget to claim your $4EVER points at: https://dashboard.4everland.org/quest/tp
🥳We are thrilled to announce that UXLINK has made strategic partnership with @LumozOrg
to build Social Growth Layer(SGL) together!
Our ecosystem fund @UFLY_Labs
will invest @LumozOrg and we will empower Lumoz social growth & business development globally especially in Japan and Korea market & community.
💰Lumoz native token $MOZ will be #TGE on CEXs soon and we will make ONE MILLION dollar value #Airdrops to qualified $UXLINK holders and stakers!
Lumoz is the leading Modular Compute Layer for ZK & AI. Lumoz uses PoW mining mechanism to provide computing power for Rollup, ZK-ML and ZKP verification.
Please stay tuned for our updates!❤️
Channel: Legit Airdrop ️
Members: ~142.24K
💢 Username: @legit365airdropss
Description:
Welcome dear subscribers! We will do our best to share the legit airdrop campaigns timely. If You Need Any Airdrop Project Promotion Then Contract here @Legit365airdrop1 Buy ads: https://telega.io/c/legit365airdropss
🏷 Tags: #airdrop
#airdrops#cryptocurrency
https://telegramchannels.me/channels/legit365airdropss
$ORB and $MOZ #Airdrops done just now, #UXLINKseason2 stakers please kindly check your wallet address to get the token❤️https://arbiscan.io/address/0x0698e377ca9dbfb5c77503d611c6f1f38cf46ba2
#Airdrops Are Making Millionaires In Crypto – Here’s How [Full Guide Cosmos, LUNA & More]
#cryptogemtokenshttps://cryptogemtokens.com/airdrops-are-making-millionaires-in-crypto-heres-how-full-guide-cosmos-luna-more/
Phantom Wallet Dismisses Token Rumors
Phantom Wallet team clarifies: no plans for a native token or airdrop. Focus remains on improving the token and app discovery mechanism. More details: Read here
#Phantom#airdrops#wallets#Crypto#VC