Что-то вы гоните насчет "привычного вида формата 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
India GST collections hit ₹2.43T in Apr’26 vs ₹2.23T (ex-cess) last year, +8.7% YoY; net GST ₹2.11T, +7.3%. Import-linked GST up 25.8%. Despite tax cuts, higher taxable value signals consumption strength; FY27 Centre target ₹10.2T.
#Economy
Centre to maintain FY27 capex at ₹12.22 lakh crore (+~9% YoY) vs ₹2 lakh crore in FY15. Govt to exit non-strategic sectors to crowd in private investment; LPG imports at ~60% with ~90% via Hormuz flagged as risk. R&D spend at 0.6% of GDP under review. #Economy
🇮🇳🤝🇨🇳 India gives fast track nod for China FDI in seven sectors
“These are capital goods, electronic capital goods, electronic components, polysilicon and ingot wafer, advanced battery components, rare earth permanent magnets, and rare earth processing”
#Economy
https://t.co/w0FYHf2dWh
Invest India brings in $6.1 bn investments across 60 projects in FY26 and It is estimated that India will attract investment worth $90 billion this year.
#Economy
Reliance Industries just posted ₹95,754 crore in annual profit. That is over $10 billion. First Indian company in history to cross that line.
The $10 billion profit club globally has maybe 50 companies. India just put one in it. #Economy
According to April 2026 IMF data, India has slipped to the 6th largest economy, falling behind the UK ($4.26T) with a projected FY27 nominal GDP of $4.15 trillion.
The decline is not due to a reduction in real economic growth, but primarily caused by a weakening Indian Rupee against the US Dollar and a downward revision of nominal GDP following a base-year change in Feb 2026.
#Economy