Skip Menu |

This queue is for tickets about the MacOSX-File CPAN distribution.

Report information
The Basics
Id: 57170
Status: new
Priority: 0/
Queue: MacOSX-File

Owner: Nobody in particular
Requestors: mike [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: bug: MacOSX::File::Copy->copy() fails from a mounted disk image
Date: Mon, 3 May 2010 14:54:09 +0100
To: bug-MacOSX-File [...]
From: Mike Elston <mike [...]>
Download (untitled) / with headers
text/plain 1.6k
I wanted to use MacOSX::File to copy files from a backup produced by Apple's Backup application (on Mac OS X 10.4 Tiger). This application creates sparse disk images which may be mounted by 'hdiutil attach', and the mounted volume contains the files backed up. However, trying to copy a file using MacOSX::File::Copy from this mounted image to a hard disk fails, reporting 'No such file or directory'. Essentially, my Perl program is as follows: use MacOSX::File::Copy; @attach = ('hdiutil', 'attach', '-quiet', '-readonly', '-private'); ... $imagefile = $backup . "/Contents/Contents/Backup.sparseimage"; system(@attach, $imagefile) == 0 or die "failed to mount backup image\n"; ... # (in a loop) copy($pathfrom, $pathto) or warn "$pathfrom: restore failed: $!\n"; This fails on every file in the backup disk image. However, simply replacing "MacOSX::File::Copy" with "File::Copy" works successfully (except of course where the MacOSX features are concerned, eg resource fork etc). Assuming this was caused by the fact that MacOSX::File uses the Carbon File Manager, while hdiutil attaches the disk image with a BSD backing store, I removed the '-private' option from the 'hdiutil attach' command. This had the effect that most files (but not all) were now copied successfully, although on most files (but not all) the copy() command still reported the same error, 'No such file or directory'. I assume this indicates a problem using the Carbon File Manager on disk images mounted by hdiutil. Is there another solution? Regards /mike -- Mike Elston | CaiSys _|> consultant | MacOS, NeXT, Unix, CAI Email:

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to