Commit 8f7f5aa9 authored by dgaudet's avatar dgaudet

patch#4136: OSX filename/rsrc has been deprecated for some time, and as of OSX

10.4 it causes log spam.  the new proper use is filename/..namedfork/rsrc.  fix
from Daniel Westermann-Clark.

i found mailing list evidence back at least to 2001 that this is supported in
earlier versions of OSX.


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@597 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 7dd7b07e
...@@ -26,6 +26,10 @@ files. fix from Konrad Podloucky. ...@@ -26,6 +26,10 @@ files. fix from Konrad Podloucky.
bug#12949: eliminate an exception during fs abilities testing on OS X 10.4. bug#12949: eliminate an exception during fs abilities testing on OS X 10.4.
fix from Daniel Westermann-Clark. fix from Daniel Westermann-Clark.
patch#4136: OSX filename/rsrc has been deprecated for some time, and as of OSX
10.4 it causes log spam. the new proper use is filename/..namedfork/rsrc. fix
from Daniel Westermann-Clark.
New in v0.13.6 (2005/04/07) New in v0.13.6 (2005/04/07)
--------------------------- ---------------------------
......
...@@ -39,7 +39,7 @@ class FSAbilities: ...@@ -39,7 +39,7 @@ class FSAbilities:
hardlinks = None # True if hard linking supported hardlinks = None # True if hard linking supported
fsync_dirs = None # True if directories can be fsync'd fsync_dirs = None # True if directories can be fsync'd
dir_inc_perms = None # True if regular files can have full permissions dir_inc_perms = None # True if regular files can have full permissions
resource_forks = None # True if regular_file/rsrc holds resource fork resource_forks = None # True if regular_file/..namedfork/rsrc holds resource fork
carbonfile = None # True if Mac Carbon file data is supported. carbonfile = None # True if Mac Carbon file data is supported.
name = None # Short string, not used for any technical purpose name = None # Short string, not used for any technical purpose
read_only = None # True if capabilities were determined non-destructively read_only = None # True if capabilities were determined non-destructively
...@@ -341,18 +341,18 @@ rdiff-backup-data/chars_to_quote. ...@@ -341,18 +341,18 @@ rdiff-backup-data/chars_to_quote.
self.carbonfile = 1 self.carbonfile = 1
def set_resource_fork_readwrite(self, dir_rp): def set_resource_fork_readwrite(self, dir_rp):
"""Test for resource forks by writing to regular_file/rsrc""" """Test for resource forks by writing to regular_file/..namedfork/rsrc"""
assert dir_rp.conn is Globals.local_connection assert dir_rp.conn is Globals.local_connection
reg_rp = dir_rp.append('regfile') reg_rp = dir_rp.append('regfile')
reg_rp.touch() reg_rp.touch()
s = 'test string---this should end up in resource fork' s = 'test string---this should end up in resource fork'
try: try:
fp_write = open(os.path.join(reg_rp.path, 'rsrc'), 'wb') fp_write = open(os.path.join(reg_rp.path, '..namedfork', 'rsrc'), 'wb')
fp_write.write(s) fp_write.write(s)
assert not fp_write.close() assert not fp_write.close()
fp_read = open(os.path.join(reg_rp.path, 'rsrc'), 'rb') fp_read = open(os.path.join(reg_rp.path, '..namedfork', 'rsrc'), 'rb')
s_back = fp_read.read() s_back = fp_read.read()
assert not fp_read.close() assert not fp_read.close()
except (OSError, IOError), e: self.resource_forks = 0 except (OSError, IOError), e: self.resource_forks = 0
...@@ -370,7 +370,7 @@ rdiff-backup-data/chars_to_quote. ...@@ -370,7 +370,7 @@ rdiff-backup-data/chars_to_quote.
for rp in selection.Select(dir_rp).set_iter(): for rp in selection.Select(dir_rp).set_iter():
if rp.isreg(): if rp.isreg():
try: try:
rfork = rp.append('rsrc') rfork = rp.append(os.path.join('..namedfork', 'rsrc'))
fp = rfork.open('rb') fp = rfork.open('rb')
fp.read() fp.read()
assert not fp.close() assert not fp.close()
......
...@@ -1141,7 +1141,7 @@ class RPath(RORPath): ...@@ -1141,7 +1141,7 @@ class RPath(RORPath):
try: rfork = self.data['resourcefork'] try: rfork = self.data['resourcefork']
except KeyError: except KeyError:
try: try:
rfork_fp = self.conn.open(os.path.join(self.path, 'rsrc'), rfork_fp = self.conn.open(os.path.join(self.path, '..namedfork', 'rsrc'),
'rb') 'rb')
rfork = rfork_fp.read() rfork = rfork_fp.read()
assert not rfork_fp.close() assert not rfork_fp.close()
...@@ -1152,7 +1152,7 @@ class RPath(RORPath): ...@@ -1152,7 +1152,7 @@ class RPath(RORPath):
def write_resource_fork(self, rfork_data): def write_resource_fork(self, rfork_data):
"""Write new resource fork to self""" """Write new resource fork to self"""
log.Log("Writing resource fork to %s" % (self.index,), 7) log.Log("Writing resource fork to %s" % (self.index,), 7)
fp = self.conn.open(os.path.join(self.path, 'rsrc'), 'wb') fp = self.conn.open(os.path.join(self.path, '..namedfork', 'rsrc'), 'wb')
fp.write(rfork_data) fp.write(rfork_data)
assert not fp.close() assert not fp.close()
self.set_resource_fork(rfork_data) self.set_resource_fork(rfork_data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment