|
* TinkerDifferent *
Retro Computing Community |
| Home | Forums | What's New | Search | Settings |
| Hiding "dot" files in Classic? |
Forums > Vintage Apple > Software & Operating Systems
|
misterg33 New Tinkerer -------- Joined: Oct 10, 2022 Posts: 61 Likes: 14 |
May 22, 2023 - #1
Wondering if anyone knows of an extension or a ResEdit hack for automatically hiding files beginning with a period (like .ds_store) in classic Finder. A lot of files and folders that are invisible on OS X show up when mounting the same drive over AFP in OS 9 and earlier. If there's a terminal command for the OS X side of things to adjust the AFP server to hide these, that would work, too. Thanks in advance!
|
|
joevt Tinkerer -------- Joined: Mar 5, 2023 Posts: 218 Likes: 85 |
May 22, 2023 - #2
Use
SetFile -a I filepath in Mac OS X to set the Invisible flag? Test it on a single file first.
|
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
May 23, 2023 - #3
What's AFP?
I doubt there is an existing extension to do this (and I strongly doubt a ResEdit hack could do it), but I might enjoy writing one this week. What version of Classic are you running in practice? |
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
May 23, 2023 - #4
Technical note: I haven't been able to find (yet) how Finder 7.5.5 checks if a file is supposed to be invisible. It doesn't seem to use either PBGetFInfo or PBGetCatInfo. (Or rather, it does cycle thru PBGetCatInfo once for every file when it opens a folder window, just as I expected ... but manually setting the fInvisible bit in the PBRec that comes back in A0 doesn't actually prevent Finder from displaying the file, which is surprising.)
|
|
Patrick Tinkerer -------- Joined: Oct 26, 2021 Posts: 435 Likes: 226 |
May 23, 2023 - #5
kinda went away in Mac os 10.8 or so. personally, i get AFP and AFS and apple talk all mixed up. could you just make a classic app that looks at all the file names, and then sets the hidden bit on them ? and then one could just run that sometimes ? maybe one could even do that in a script on the file server side if its a unix-like |
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
May 23, 2023 - #6
Oh sure, but it's much more fun to hack the Finder
Liked by Patrick |
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
May 24, 2023 - #7
Hey @misterg33 try this hack I made tonight.
Drop it in your System Folder. It tricks Mac OS (tested under 7.5.5 only so far) into thinking that any file whose name begins with a dot is invisible. To try it out: open any folder. Rename a file to start with a dot. Close and reopen the folder. Voila .... your file is invisible! If you need to see your invisible files, you can remove this from your System Folder or use an app like ResEdit that lets you modify invisible files (e.g. to rename them without the dot). I played around with a trick where if you hold the Option key the finder will show your invisible files, and it was very cool, but it appears somehow that the Finder loses track of the location of 'invisible' files if you try to move them ... oops. Seems dangerous so I left that out for now ... Hope you like it.
Liked by RickLawson |
|
misterg33 New Tinkerer -------- Joined: Oct 10, 2022 Posts: 61 Likes: 14 |
May 24, 2023 - #8
Someone asked what version of classic -- OS 9, 8.6, and System 7.6.1 on actual old beige Macs I fiddle with from time to time. Which explains why I'm using AFP to connect to the OS X computer. It's still running an older version of X, so I managed to get AFP working (though I have heard you can install something like Netatalk to do something similar).
Someone else posted a terminal command -- appreciate it, but there's just too many files to do that to manually. Every subfolder has invisible files in it that store various OS X stuff. Gonna try the hack Crutch has uploaded. It sounds like just what I was looking for. I'll let you know what happens! |
|
joevt Tinkerer -------- Joined: Mar 5, 2023 Posts: 218 Likes: 85 |
May 24, 2023 - #9
Once you verify that
SetFile can work, then you can combine it in a script to do all such files. Use the find command to find all files that have a name that begins with a dot and pass each file to the SetFile command.This command finds all folders and files that have a name that begins with a . starting in the current directory. It is recursive so it will also search all sub folders.find . -name '.?*'You can replace . with a list of volumes and folders you want it to process. find /Volume/volumename1 /Volume/volumename2 -name '.?*'Volumes are listed by the mount command.Here's another command that will list all the dot files and shows which ones already have the invisible flag:
Changing the invisible flag won't modify the dates of the file. Once you're sure about the files you want to make invisible, you can make find execute commands against the files, like this:find . -name '.?*' -exec SetFile -a V {} \;SetFile can work with multiple files at a time which is faster than doing one file at a time. To make find pass multiple files to SetFile, use the + option in the find command like this:find . -name '.?*' -exec SetFile -V {} \+The + method doesn't exist in some old macOS versions. It exists in the versions listed here:
In that case, xargs can be used instead of the + option as described at:https://www.everythingcli.org/find-exec-vs-find-xargs/ Like this: find . -name '.?*' -print0 | xargs -0 SetFile -a VThe xargs parallel mode described in that linked article exists in the macOS versions listed below but I don't know if it improves performance when -n1 is not used:
Liked by Patrick |
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
May 24, 2023 - #10
Thanks, here's a little demo. It's quick and easy. I hope this is useful to you. I will post an update by tomorrow that lets you temporarily see dotfiles by holding down a modifier key when you open a window in the Finder. (I found the solution to the wrinkle I mentioned above. Liked by retr01,Patrickanderic |
|
Patrick Tinkerer -------- Joined: Oct 26, 2021 Posts: 435 Likes: 226 |
May 24, 2023 - #11
i love how we have both solutions on this thread. with a little howto write scripts thrown in!
|
|
misterg33 New Tinkerer -------- Joined: Oct 10, 2022 Posts: 61 Likes: 14 |
May 25, 2023 - #12
Crutch -- unfortunately it didn't appear to do anything under OS 8.6 or OS 9 on either local files, or files on mounted AFP volumes. Did you upload the most current version?
|
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
May 25, 2023 - #13
Oh bummer. Thanks for letting me know. I only have a 7.5.5 setup so the Finder probably changed in a way that will require a tweak. I will have to do a little more work to find a version that works under OS 8/9. I will try this weekend.
|
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
Jun 1, 2023 - #14
All right @misterg33 try this one.
I have tested thoroughly under 7.5.5 and am running it myself on my dev setup continually with no issues. I still haven't installed OS8/9 (and probably won't anytime soon - just too busy with life) but I patched every possible trap I could think of that the Finder might use to get/set finder info here. So it should work unless the Finder is doing something very new and different in OS8/9 that I don't know about. Crashes possible since I haven't tested in those systems but I do think this is probably at least safe. As with anything, please only try on files you don't care about to start with though, just in case. :) Features:
Liked by ClassicHasClass |
|
ClassicHasClass Tinkerer -------- Joined: Aug 30, 2022 Posts: 386 Likes: 215 |
Jun 1, 2023 - #15
I look forward to the source code! That sounds like a clever solution.
|
|
misterg33 New Tinkerer -------- Joined: Oct 10, 2022 Posts: 61 Likes: 14 |
Jun 3, 2023 - #16
Will try to test this out this weekend. The scsi2sd in my classic mac decided to forget all of its settings this week, so it might be a while.
Liked by Patrick |
|
misterg33 New Tinkerer -------- Joined: Oct 10, 2022 Posts: 61 Likes: 14 |
Jun 5, 2023 - #17
Got the Mac up and running. Regrettably no luck with the new version of the extension. It appeared to cause the Finder to crash when opening AFP volumes. It also seemed to cause a slowdown on 8.6. Thank you for trying ! If you ever post the source code anywhere, I'd be interested in taking a look to see what it was trying to do anyway.
I did find a STR# resource 3611 and 3612 in OS 9 for the names of invisible items in Finder (like Desktop DB and AppleShare PDS), but changing the text to the folders I wanted hidden didn't seem to do anything. |
|
Crutch Tinkerer Chicago -------- Joined: Jul 10, 2022 Posts: 293 Likes: 228 |
Jun 5, 2023 - #18
Jeez! Bummer. I will have to actually install MacOS 8/9 one day and figure out what's going on there ... well if you ever want to hide dotfiles in 7.x this is here!
|
| Page 1 of 1 |
| Home | Forums | What's New | Search | Bookmarks | RSS | Original | Settings |
| XenForo Retro Proxy by TinkerDifferent.com |