Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0a9d7559
Kaydet (Commit)
0a9d7559
authored
Agu 05, 2002
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
In copy() don't try to obtain an FSSpec until we know the destination
exists. Partial fix for #585923.
üst
11845e00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
macostools.py
Mac/Lib/macostools.py
+12
-6
No files found.
Mac/Lib/macostools.py
Dosyayı görüntüle @
0a9d7559
...
@@ -27,6 +27,8 @@ BUFSIZ=0x80000 # Copy in 0.5Mb chunks
...
@@ -27,6 +27,8 @@ BUFSIZ=0x80000 # Copy in 0.5Mb chunks
def
mkalias
(
src
,
dst
,
relative
=
None
):
def
mkalias
(
src
,
dst
,
relative
=
None
):
"""Create a finder alias"""
"""Create a finder alias"""
srcfss
=
macfs
.
FSSpec
(
src
)
srcfss
=
macfs
.
FSSpec
(
src
)
# The next line will fail under unix-Python if the destination
# doesn't exist yet. We should change this code to be fsref-based.
dstfss
=
macfs
.
FSSpec
(
dst
)
dstfss
=
macfs
.
FSSpec
(
dst
)
if
relative
:
if
relative
:
relativefss
=
macfs
.
FSSpec
(
relative
)
relativefss
=
macfs
.
FSSpec
(
relative
)
...
@@ -82,13 +84,15 @@ def touched_ae(dst):
...
@@ -82,13 +84,15 @@ def touched_ae(dst):
def
copy
(
src
,
dst
,
createpath
=
0
,
copydates
=
1
,
forcetype
=
None
):
def
copy
(
src
,
dst
,
createpath
=
0
,
copydates
=
1
,
forcetype
=
None
):
"""Copy a file, including finder info, resource fork, etc"""
"""Copy a file, including finder info, resource fork, etc"""
if
hasattr
(
src
,
'as_pathname'
):
src
=
src
.
as_pathname
()
if
hasattr
(
dst
,
'as_pathname'
):
dst
=
dst
.
as_pathname
()
if
createpath
:
if
createpath
:
mkdirs
(
os
.
path
.
split
(
dst
)[
0
])
mkdirs
(
os
.
path
.
split
(
dst
)[
0
])
srcfss
=
macfs
.
FSSpec
(
src
)
dstfss
=
macfs
.
FSSpec
(
dst
)
ifp
=
open
(
src
fss
.
as_pathname
()
,
'rb'
)
ifp
=
open
(
src
,
'rb'
)
ofp
=
open
(
dst
fss
.
as_pathname
()
,
'wb'
)
ofp
=
open
(
dst
,
'wb'
)
d
=
ifp
.
read
(
BUFSIZ
)
d
=
ifp
.
read
(
BUFSIZ
)
while
d
:
while
d
:
ofp
.
write
(
d
)
ofp
.
write
(
d
)
...
@@ -96,8 +100,8 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None):
...
@@ -96,8 +100,8 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None):
ifp
.
close
()
ifp
.
close
()
ofp
.
close
()
ofp
.
close
()
ifp
=
openrf
(
src
fss
.
as_pathname
()
,
'*rb'
)
ifp
=
openrf
(
src
,
'*rb'
)
ofp
=
openrf
(
dst
fss
.
as_pathname
()
,
'*wb'
)
ofp
=
openrf
(
dst
,
'*wb'
)
d
=
ifp
.
read
(
BUFSIZ
)
d
=
ifp
.
read
(
BUFSIZ
)
while
d
:
while
d
:
ofp
.
write
(
d
)
ofp
.
write
(
d
)
...
@@ -105,6 +109,8 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None):
...
@@ -105,6 +109,8 @@ def copy(src, dst, createpath=0, copydates=1, forcetype=None):
ifp
.
close
()
ifp
.
close
()
ofp
.
close
()
ofp
.
close
()
srcfss
=
macfs
.
FSSpec
(
src
)
dstfss
=
macfs
.
FSSpec
(
dst
)
sf
=
srcfss
.
GetFInfo
()
sf
=
srcfss
.
GetFInfo
()
df
=
dstfss
.
GetFInfo
()
df
=
dstfss
.
GetFInfo
()
df
.
Creator
,
df
.
Type
=
sf
.
Creator
,
sf
.
Type
df
.
Creator
,
df
.
Type
=
sf
.
Creator
,
sf
.
Type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment