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

Резултати

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

Пребарај: #suicides

当前筛选 #suicides清除筛选
American Оbserver

@american_observer · Post #5021 · 01.02.2026 г., 17:02

Several Suicide Bombings and Armed Attacks in Pakistan The Pakistani army said on Saturday that multiple suicide bombings and armed attacks by “terrorists” in the turbulent southwestern province of Balochistan had killed 33 people, including civilians, while security forces responding to the violence had killed 92 attackers. Analysts described it as the deadliest day for militants in decades. During the attacks, Baloch insurgents targeted civilians, a high-security prison, police stations and paramilitary installations. Eighteen civilians, 15 security personnel and 92 insurgents were killed, the military said. Although Baloch separatists and the Pakistani Taliban frequently target security forces in Balochistan and elsewhere in the country, coordinated attacks of this scale are rare. According to the authorities, at least 133 militants have been killed across Balochistan in the last 48 hours, including 92 on Saturday. The army and Pakistani interior Minister Mohsin Naqvi said the attackers had the support of India. There was no immediate response from New Delhi, which has denied such allegations before. The BLA has released videos showing female fighters taking part in the attacks, apparently as part of propaganda efforts to highlight the role of women among the militants. Shahid Rind, a spokesman for the Balochistan government, said most of the attacks had been foiled. They came a day after the military said security forces attacked two militant hideouts in the country's southwest this week, killing 41 insurgents in separate shootouts. The chief minister of the province, Sarfraz Bugti, wrote on Twitter that the security forces were pursuing the insurgents. He said at least 700 insurgents had been killed by security forces in the past year. Dozens of insurgents also attacked a prison in Mastung district, freeing more than 30 inmates, police said. In other attacks, militants tried to storm the provincial headquarters of paramilitary forces in the Nushki district, but the attack was repulsed, police said. The insurgents threw grenades at the office of a government administrator in the Dalbandin district, but a quick response from the security forces forced them to flee, according to local authorities. Attacks on security posts in Balincha, Tump and Kharan districts were foiled, while in Pasni and Gwadar, insurgents tried to kidnap passengers traveling on buses along highways, police said. #attacks#suicides#attacks#pakistan 📱American Оbserver - Stay up to date on all important events 🇺🇸