1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022, Python Software Foundation
1
+ # Copyright (C) 2001-2023, Python Software Foundation
3
2
# This file is distributed under the same license as the Python package.
4
3
#
5
4
# Translators:
6
5
# Adrian Liaw <[email protected] >, 2018
7
- # Matt Wang <[email protected] >, 2021-2022
6
+ # Matt Wang <[email protected] >, 2021-2023
8
7
msgid ""
9
8
msgstr ""
10
9
"Project-Id-Version : Python 3.12\n "
@@ -74,11 +73,12 @@ msgid ""
74
73
"rely on a temporary file created using this function having or not having a "
75
74
"visible name in the file system."
76
75
msgstr ""
77
- "回傳一個可當作臨時儲存區域的 :term:`file-like object`。建立該檔案使用了與 :"
78
- "func:`mkstemp` 相同的安全規則。它將在關閉(包括當物件被垃圾回收 (garbage "
79
- "collect) 時的隱式關閉)後立即銷毀。在 Unix 下,該檔案所在的目錄可能根本不被建"
80
- "立、或者在建立檔案後立即就被刪除,其他平臺不支援此功能;你的程式不應依賴使用"
81
- "此功能建立的臨時檔案名稱,因為它在檔案系統中的名稱有可能是不可見的。"
76
+ "回傳一個可當作臨時儲存區域的\\ :term:`類檔案物件 <file-like object>`。建立該"
77
+ "檔案使用了與 :func:`mkstemp` 相同的安全規則。它將在關閉(包括當物件被垃圾回"
78
+ "收 (garbage collect) 時的隱式關閉)後立即銷毀。在 Unix 下,該檔案所在的目錄可"
79
+ "能根本不被建立、或者在建立檔案後立即就被刪除,其他平臺不支援此功能;你的程式"
80
+ "不應依賴使用此功能建立的臨時檔案名稱,因為它在檔案系統中的名稱有可能是不可見"
81
+ "的。"
82
82
83
83
#: ../../library/tempfile.rst:44
84
84
msgid ""
@@ -156,20 +156,22 @@ msgstr "新增 *errors* 參數。"
156
156
msgid ""
157
157
"This function operates exactly as :func:`TemporaryFile` does, except the "
158
158
"following differences:"
159
- msgstr ""
159
+ msgstr "此函式的操作與 :func:`TemporaryFile` 完全相同,但存在以下差異: "
160
160
161
161
#: ../../library/tempfile.rst:83
162
162
msgid ""
163
163
"This function returns a file that is guaranteed to have a visible name in "
164
164
"the file system."
165
- msgstr ""
165
+ msgstr "此函式回傳一個保證在檔案系統中具有可見名稱的檔案。 "
166
166
167
167
#: ../../library/tempfile.rst:85
168
168
msgid ""
169
169
"To manage the named file, it extends the parameters of :func:`TemporaryFile` "
170
170
"with *delete* and *delete_on_close* parameters that determine whether and "
171
171
"how the named file should be automatically deleted."
172
172
msgstr ""
173
+ "為了管理指定檔案,它使用 *delete* 和 *delete_on_close* 參數擴充 :func:"
174
+ "`TemporaryFile` 來指定是否以及如何自動刪除指定檔案。"
173
175
174
176
#: ../../library/tempfile.rst:89
175
177
msgid ""
@@ -181,6 +183,11 @@ msgid ""
181
183
"`TemporaryFile`, the directory entry does not get unlinked immediately after "
182
184
"the file creation."
183
185
msgstr ""
186
+ "回傳的物件始終是一個\\ :term:`類檔案物件 <file-like object>`,其 :attr:`!"
187
+ "file` 屬性是底層的真實檔案物件。這個\\ :term:`類檔案物件 <file-like "
188
+ "object>`\\ 可以在 :keyword:`with` 陳述式中使用,就像普通檔案一樣。臨時檔案的"
189
+ "名稱可以從回傳的類檔案物件的 :attr:`name` 屬性中取得。在 Unix 上則與 :func:"
190
+ "`TemporaryFile` 不同,目錄條目不會在檔案建立後立即被取消鏈接 (unlink)。"
184
191
185
192
#: ../../library/tempfile.rst:97
186
193
msgid ""
@@ -191,6 +198,12 @@ msgid ""
191
198
"not always guaranteed in this case (see :meth:`object.__del__`). If *delete* "
192
199
"is false, the value of *delete_on_close* is ignored."
193
200
msgstr ""
201
+ "如果 *delete* 為 true(預設值)並且 *delete_on_close* 為 true(預設值),則檔"
202
+ "案在關閉後會立即被刪除。如果 *delete* 為 true 並且 *delete_on_close* 為 "
203
+ "false,則僅在情境管理器退出時刪除檔案,或者在\\ :term:`類檔案物件 <file-like "
204
+ "object>`\\ 完結時刪除檔案。在這種情況下,並不總是保證能成功刪除(請參閱 :"
205
+ "meth:`object.__del__`\\ )。如果 *delete* 為 false,則會忽略 "
206
+ "*delete_on_close* 的值。"
194
207
195
208
#: ../../library/tempfile.rst:104
196
209
msgid ""
@@ -201,32 +214,38 @@ msgid ""
201
214
"false. The latter approach is recommended as it provides assistance in "
202
215
"automatic cleaning of the temporary file upon the context manager exit."
203
216
msgstr ""
217
+ "因此,要在關閉檔案後使用臨時檔案的名稱重新打開檔案,請確保在關閉時不刪除檔案"
218
+ "(將 *delete* 參數設定為 false),或者如果臨時檔案是以 :keyword:`with` 陳述式"
219
+ "建立,要將 *delete_on_close* 參數設定為 false。建議使用後者,因為它有助於在情"
220
+ "境管理器退出時自動清理臨時檔案。"
204
221
205
222
#: ../../library/tempfile.rst:111
206
223
msgid ""
207
224
"Opening the temporary file again by its name while it is still open works as "
208
225
"follows:"
209
- msgstr ""
226
+ msgstr "在臨時檔案仍處於打開狀態時再次按其名稱打開它,其作用方式如下: "
210
227
211
228
#: ../../library/tempfile.rst:114
212
229
msgid "On POSIX the file can always be opened again."
213
- msgstr ""
230
+ msgstr "在 POSIX 上,檔案始終可以再次打開。 "
214
231
215
232
#: ../../library/tempfile.rst:115
216
233
msgid ""
217
234
"On Windows, make sure that at least one of the following conditions are "
218
235
"fulfilled:"
219
- msgstr ""
236
+ msgstr "在 Windows 上,確保至少滿足以下條件之一: "
220
237
221
238
#: ../../library/tempfile.rst:118
222
239
msgid "*delete* is false"
223
- msgstr ""
240
+ msgstr "*delete* 為 false "
224
241
225
242
#: ../../library/tempfile.rst:119
226
243
msgid ""
227
244
"additional open shares delete access (e.g. by calling :func:`os.open` with "
228
245
"the flag ``O_TEMPORARY``)"
229
246
msgstr ""
247
+ "額外的 open 會共享刪除存取權限(例如,通過使用旗標 ``O_TEMPORARY`` 來呼叫 :"
248
+ "func:`os.open`\\ )"
230
249
231
250
#: ../../library/tempfile.rst:121
232
251
msgid ""
@@ -236,6 +255,10 @@ msgid ""
236
255
"func:`os.unlink` call on context manager exit will fail with a :exc:"
237
256
"`PermissionError`."
238
257
msgstr ""
258
+ "*delete* 為 true 但 *delete_on_close* 為 false。請注意,在這種情況下不共享刪"
259
+ "除存取權限的其他 open(例如透過內建的 :func:`open` 建立)必須在退出情境管理器"
260
+ "之前關閉,否則情境管理器上的 :func:`os.unlink` 呼叫退出將失敗並出現 :exc:"
261
+ "`PermissionError`。"
239
262
240
263
#: ../../library/tempfile.rst:127
241
264
msgid ""
@@ -246,12 +269,18 @@ msgid ""
246
269
"requested by the open, which fails immediately if the requested access is "
247
270
"not granted."
248
271
msgstr ""
272
+ "在 Windows 上,如果 *delete_on_close* 為 false,並且檔案是在使用者缺乏刪除存"
273
+ "取權限的目錄中建立的,則情境管理器退出時的 :func:`os.unlink` 呼叫將失敗,並引"
274
+ "發 :exc:`PermissionError`。當 *delete_on_close* 為 true 時,不會發生這種情"
275
+ "況,因為刪除存取權限是由 open 來要求的,如果未授予存取權限則會立即失敗。"
249
276
250
277
#: ../../library/tempfile.rst:134
251
278
msgid ""
252
279
"On POSIX (only), a process that is terminated abruptly with SIGKILL cannot "
253
280
"automatically delete any NamedTemporaryFiles it created."
254
281
msgstr ""
282
+ "(僅)在 POSIX 上,因使用 SIGKILL 而被終止的行程無法自動刪除它建立的任何 "
283
+ "NamedTemporaryFiles。"
255
284
256
285
#: ../../library/tempfile.rst:142
257
286
msgid "Added *delete_on_close* parameter."
@@ -299,6 +328,8 @@ msgid ""
299
328
"abstract base classes (depending on whether binary or text *mode* was "
300
329
"specified)."
301
330
msgstr ""
331
+ "完全實作 :class:`io.BufferedIOBase` 和 :class:`io.TextIOBase` 抽象基底類別"
332
+ "(取決於指定的是二進位還是文本 *mode*\\ )。"
302
333
303
334
#: ../../library/tempfile.rst:178
304
335
msgid ""
@@ -349,6 +380,9 @@ msgid ""
349
380
"during debugging or when you need your cleanup behavior to be conditional "
350
381
"based on other logic."
351
382
msgstr ""
383
+ "*delete* 參數可以停用在退出情境時對目錄樹的清理,雖然停用情境管理器在退出情境"
384
+ "時所採取的操作似乎不常見,但它在除錯期間或當你需要基於其他邏輯的清理行為時會"
385
+ "非常有用。"
352
386
353
387
#: ../../library/tempfile.rst:204 ../../library/tempfile.rst:284
354
388
msgid ""
@@ -494,13 +528,13 @@ msgstr ""
494
528
495
529
#: ../../library/tempfile.rst:282
496
530
msgid ":func:`mkdtemp` returns the absolute pathname of the new directory."
497
- msgstr ""
531
+ msgstr ":func:`mkdtemp` 回傳新目錄的絕對路徑名稱。 "
498
532
499
533
#: ../../library/tempfile.rst:295
500
534
msgid ""
501
535
":func:`mkdtemp` now always returns an absolute path, even if *dir* is "
502
536
"relative."
503
- msgstr ""
537
+ msgstr ":func:`mkdtemp` 現在都會回傳絕對路徑,即使 *dir* 是相對路徑。 "
504
538
505
539
#: ../../library/tempfile.rst:301
506
540
msgid ""
0 commit comments