TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #281 · 18 авг.

Что-то вы гоните насчет "привычного вида формата 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

Резултати

Пронајдени 3 слични објави

Пребарај: #russiaadmmplus

当前筛选 #russiaadmmplus清除筛选
Russian Mission to ASEAN

@aseanrussia · Post #739 · 16.11.2023 г., 06:31

🇷🇺🇧🇳🇰🇭🇮🇩🇱🇦🇲🇾🇲🇲🇵🇭🇸🇬🇹🇭🇻🇳 Deputy Minister of Defence of the Russian Federation AleksandrFomin is taking part in the 10th ASEAN Defence Ministers’ Meeting Plus (ADMM-Plus). 📍 Jakarta, November 16 #RussiaADMMPlus

Russian Mission to ASEAN

@aseanrussia · Post #741 · 16.11.2023 г., 17:51

🗓 On November 16, Deputy Minister of Defence of the Russian Federation Aleksandr Fomin 🇷🇺 headed Russian delegation at the 10th ASEAN Defence Ministers’ Meeting Plus (ADMM-Plus) in Jakarta, Indonesia 🇮🇩. 💬All these years the Russian Ministry of Defence has been actively engaged in the ADMM-Plus process and continues to contribute to strengthening our common security. Russia supports all positive initiatives put forward by other partners in all spheres of military cooperation. 🔹️On the sidelines of the meeting, Colonel General Aleksandr Fomin held bilateral meetings with the heads of the defence ministries of Laos 🇱🇦, Brunei 🇧🇳, Indonesia 🇮🇩, and the Secretary-General of #ASEAN. #RussiaADMMPlus

Russian Mission to ASEAN

@aseanrussia · Post #1404 · 22.11.2024 г., 07:46

🗓 On November 21, Deputy Minister of Defence of the Russian Federation, Colonel General Aleksandr Fomin🇷🇺 participated in the 11th ASEAN Defence Ministers’ Meeting Plus (#ADMM-Plus) in Vientiane, the Lao PDR 🇱🇦. 🔹️In his address to ADMM Plus, the Russian Deputy Defence Minister outlined Russia's position on the most pressing security issues facing the world and the Asia-Pacific region. 🔹️At the event, ASEAN Member States confirmed their readiness to work with the Russian Ministry of Defence in key areas of military cooperation of mutual interest. 🔹️On the sidelines of the meeting, Colonel General Aleksandr Fomin held bilateral meetings with the heads of the defence ministries of Vietnam 🇻🇳, Laos 🇱🇦, Malaysia 🇲🇾 and East Timor 🇹🇱 to discuss in detail bilateral military cooperation as well as prospects for cooperation in regional multilateral formats, in particular ADMM Plus. #RussiaADMMPlus