Что-то вы гоните насчет "привычного вида формата 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
In the Middle Ages, punishment for “deviant” sexual positions could be harsh. For example, the punishment for a woman-on-top position was three years’ penance. People feared that such a position reversed the natural order of the “superior” male and “inferior” female.
@googlefactss#sex
[read more...]
Julia Varvaro, 29, was put on leave from her job as the Deputy Assistant Secretary for Counterterrorism on Wednesday afternoon, hours after we revealed her shameless money-grabbing antics with a much older boyfriend who gave his name as Robert B.
A Department of Homeland Security source told the Daily Mail: 'Julia Varvaro is on administrative leave as a result of the investigation and she is no longer serving in her capacity as a Deputy Assistant Secretary at DHS.'
Varvaro's hunger for money and gifts from older men sparked national security fears.
One of the 'sugar daddies,' Robert B, a 57-year-old divorced father told his story to the Daily Mail after meeting Varvaro on a notorious website.
#Sex#Security
👂More on Trump's Ear ⚠️
India’s Supreme Court has recognized prostitution as a profession. Therefore, the police should refrain from intervening if a sex worker is of legal age and is participating with consent.
But not every sex worker does the job on their own. India’s Muzaffarpur red-light district is home to more than 2,500 sex workers. Most are there due to poverty or were sold, kidnapped or coerced to follow in their mothers’ footsteps. Watch the story of Chandini, who was sold into prostitution by her parents in our video.
To learn more about the dark business, including prostitution and people trafficking, watch the documentary film Dance, Sex, Dance.
#India#sex#prostitution
Follow: https://t.me/rtdocumentary