الفرق بين المراجعتين ل"Python/pathlib/Path/touch"

من موسوعة حسوب
< Python‏ | pathlib‏ | Path
اذهب إلى التنقل اذهب إلى البحث
(أنشأ الصفحة ب'== التابع Path.cwd == يعيد كائن مسار جديدًا يمثّل المسار الحالي (بشكل مشابه للتابع os.getcwd)<syntaxhighlight lan...')
 
سطر 1: سطر 1:
== التابع Path.cwd ==
+
== التابع Path.touch ==
يعيد كائن مسار جديدًا يمثّل المسار الحالي (بشكل مشابه للتابع os.getcwd)<syntaxhighlight lang="python3">
+
Create a file at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If the file already exists, the function succeeds if exist_ok is true (and its modification time is updated to the current time), otherwise FileExistsError is raised.<span> </span>
>>> Path.cwd()
 
 
 
PosixPath('/home/antoine/pathlib')
 
 
 
 
 
</syntaxhighlight><span> </span>
 

مراجعة 07:49، 3 أغسطس 2018

التابع Path.touch

Create a file at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If the file already exists, the function succeeds if exist_ok is true (and its modification time is updated to the current time), otherwise FileExistsError is raised.