From 14f5ad3728aab2eab900be7525c2785f4a350832 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Thu, 6 Oct 2022 17:11:32 -0500 Subject: [PATCH] MiniVMac.cc: Preserve attributes when copying When copying files from the system disk image to the new disk image, preserve all attributes (creation date, modification date, bundle bit, locked bit, etc.), except clear the inited bit so that the Finder chooses new icon positions, otherwise (under System 6 at least) the icons pile up on top of each other. Preserving the bundle bit in particular tells the Finder to look in the file for icon information when building the desktop database, without which the files all show generic icons in the Finder. --- LaunchAPPL/Client/MiniVMac.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LaunchAPPL/Client/MiniVMac.cc b/LaunchAPPL/Client/MiniVMac.cc index 4312cd7ef2..3426f33d88 100644 --- a/LaunchAPPL/Client/MiniVMac.cc +++ b/LaunchAPPL/Client/MiniVMac.cc @@ -460,6 +460,8 @@ void MiniVMacLauncher::CopySystemFile(const std::string &fn, bool required) hfs_setfork(out, 1); hfs_read(in, buffer.data(), fileent.u.file.rsize); hfs_write(out, buffer.data(), fileent.u.file.rsize); + fileent.fdflags &= ~HFS_FNDR_HASBEENINITED; + hfs_fsetattr(out, &fileent); hfs_close(in); hfs_close(out); }