Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
06033198
Commit
06033198
authored
Mar 12, 1996
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use MacOS.openrf (if it is available) for opening resource forks
Copy in .5Mb chunks in stead of 1Mb
parent
db9ff36a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Mac/Lib/macostools.py
Mac/Lib/macostools.py
+9
-3
No files found.
Mac/Lib/macostools.py
View file @
06033198
...
...
@@ -8,12 +8,18 @@ import macfs
import
Res
import
os
from
MACFS
import
*
import
MacOS
try
:
openrf
=
MacOS
.
openrf
except
AttributeError
:
# Backward compatability
openrf
=
open
Error
=
'macostools.Error'
FSSpecType
=
type
(
macfs
.
FSSpec
(
':'
))
BUFSIZ
=
0x
100000
# Copy in 1
Mb chunks
BUFSIZ
=
0x
80000
# Copy in 0.5
Mb chunks
#
# Not guaranteed to be correct or stay correct (Apple doesn't tell you
...
...
@@ -64,8 +70,8 @@ def copy(src, dst, createpath=0):
ifp
.
close
()
ofp
.
close
()
ifp
=
open
(
srcfss
.
as_pathname
(),
'*rb'
)
ofp
=
open
(
dstfss
.
as_pathname
(),
'*wb'
)
ifp
=
open
rf
(
srcfss
.
as_pathname
(),
'*rb'
)
ofp
=
open
rf
(
dstfss
.
as_pathname
(),
'*wb'
)
d
=
ifp
.
read
(
BUFSIZ
)
while
d
:
ofp
.
write
(
d
)
...
...
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