@LeagueOfLegendsLatamSur · Post #2619 · 25.02.2021 г., 19:54
#Sad
Hashtags
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
Пребарај: #sad
@LeagueOfLegendsLatamSur · Post #2619 · 25.02.2021 г., 19:54
#Sad
Hashtags
@ukraine_war_truth · Post #44 · 24.11.2024 г., 02:20
Ukraine has 2-7 trillion dollars of minerals that the US wants to get its hands on. Remember how at the beginning of the war Western propaganda claimed this was some righteous fight for democracy, lol? Light VS dark struggle? Well, no one is even pretending anymore - its all about the Benjamins. And if Western politicians and American and global corporations that have made hundreds of billion off of this suffering always knew that, it might be a surprise to some good-hearted people in the West who believed those lies. Show this clip to them, please. I also found a version with Ukrainian subtitles. If you have any friends from there, forward it to them too, please. So that they know what almost a million of their sons, fathers and husbands have died for - so that America can exploit their country for generations to come... #sad. Very, very sad, as the future president likes to say... Please subscribe to our channel - help share the Ukraine War Truth! Peace!
Hashtags
@Lash_gif · Post #40908 · 15.08.2023 г., 19:23
#girl | #sad clb: #other
@Lash_gif · Post #35410 · 09.01.2023 г., 16:18
#girl | #sad Clb: #other
@Lash_gif · Post #34813 · 26.11.2022 г., 07:54
#girl | #sad Clb: #other
@Lash_gif · Post #34722 · 19.11.2022 г., 07:35
#girl | #sad Clb: #other
@Lash_gif · Post #43260 · 16.01.2024 г., 02:59
#boy | #sad Clb: #other
@Lash_gif · Post #41283 · 31.08.2023 г., 17:44
#boy | #sad Clb: #other
@Lash_gif · Post #41126 · 22.08.2023 г., 11:49
#boy | #sad Clb: #other
@Lash_gif · Post #39644 · 30.06.2023 г., 08:32
#boy | #sad Clb: #other
@Lash_gif · Post #39577 · 27.06.2023 г., 07:06
#boy | #sad Clb: #other
@Lash_gif · Post #39486 · 23.06.2023 г., 06:52
#boy | #sad Clb: #other