1 00:00:00,05 --> 00:00:01,04 - [Instructor] While we're on the topic 2 00:00:01,04 --> 00:00:03,01 of Apple specific files starting 3 00:00:03,01 --> 00:00:04,02 with a dot or period, 4 00:00:04,02 --> 00:00:05,06 I'd like to take a few minutes to talk 5 00:00:05,06 --> 00:00:07,06 about another kind of file that the Mac seems 6 00:00:07,06 --> 00:00:09,03 to scatter around. 7 00:00:09,03 --> 00:00:11,02 If we customize anything in a folder view 8 00:00:11,02 --> 00:00:13,08 in Finder on Mac Os, such as placing icons 9 00:00:13,08 --> 00:00:16,02 in custom locations, or changing the view preferences 10 00:00:16,02 --> 00:00:18,03 for that folder, Mac OS will create a file 11 00:00:18,03 --> 00:00:21,08 in that folder called .DS_store. 12 00:00:21,08 --> 00:00:25,03 These DS store files, Short Forward Desktop Services Store, 13 00:00:25,03 --> 00:00:27,04 contain the data for a given folders appearance, 14 00:00:27,04 --> 00:00:30,01 if there have been any Mac OS specific changes made. 15 00:00:30,01 --> 00:00:31,08 And the file can be read by other Mac's 16 00:00:31,08 --> 00:00:34,00 to apply those transformations or preferences when 17 00:00:34,00 --> 00:00:35,04 a folder is viewed there. 18 00:00:35,04 --> 00:00:37,03 For example, if the customizations were made 19 00:00:37,03 --> 00:00:39,03 on a portable or shared disc. 20 00:00:39,03 --> 00:00:41,01 This is not file system metadata. 21 00:00:41,01 --> 00:00:43,09 It's more like a configuration file for Finder. 22 00:00:43,09 --> 00:00:45,09 But these files are common enough that it's important 23 00:00:45,09 --> 00:00:47,00 to know what they are. 24 00:00:47,00 --> 00:00:48,02 And, we should know about them, 25 00:00:48,02 --> 00:00:49,07 because they can contain information 26 00:00:49,07 --> 00:00:51,03 about other files. 27 00:00:51,03 --> 00:00:52,08 In addition to being generated for us, 28 00:00:52,08 --> 00:00:54,03 when we customize a Finder view, 29 00:00:54,03 --> 00:00:56,04 DS store files are also often used 30 00:00:56,04 --> 00:00:58,02 in standalone software installers. 31 00:00:58,02 --> 00:01:00,00 Where we open a disc image file and there's 32 00:01:00,00 --> 00:01:01,04 a little icon with an arrow, or 33 00:01:01,04 --> 00:01:03,03 some other custom background art, pointing 34 00:01:03,03 --> 00:01:06,00 to an alias for the applications folder. 35 00:01:06,00 --> 00:01:09,00 For example, I'll open up a Firefox installer here. 36 00:01:09,00 --> 00:01:10,08 This visual effect is often accomplished 37 00:01:10,08 --> 00:01:13,05 with a pre-designed DS store file and the hidden flag 38 00:01:13,05 --> 00:01:14,05 on other files, 39 00:01:14,05 --> 00:01:16,09 to hide anything that the user shouldn't see. 40 00:01:16,09 --> 00:01:22,02 I'll turn on invisibles here with command, shift, period. 41 00:01:22,02 --> 00:01:24,03 And notice there's some other files. 42 00:01:24,03 --> 00:01:26,00 These items are both invisible, because they start 43 00:01:26,00 --> 00:01:27,02 with a period. 44 00:01:27,02 --> 00:01:28,07 And this disc image has been customized 45 00:01:28,07 --> 00:01:29,07 with a background image. 46 00:01:29,07 --> 00:01:30,09 Stored in this directory. 47 00:01:30,09 --> 00:01:34,04 And it has a custom image set for its volume as well. 48 00:01:34,04 --> 00:01:38,00 This is the big version of this little icon up here. 49 00:01:38,00 --> 00:01:41,02 The icon size and position are stored in a DS store file, 50 00:01:41,02 --> 00:01:44,07 but we don't see that here. 51 00:01:44,07 --> 00:01:48,08 I'll switch over to my terminal. 52 00:01:48,08 --> 00:01:53,07 And move into this disc image. 53 00:01:53,07 --> 00:01:56,03 Here's that DS store file. 54 00:01:56,03 --> 00:01:58,07 For Mac users, these DS store files are, usually, 55 00:01:58,07 --> 00:02:01,02 not a problem if we're working within the GUI. 56 00:02:01,02 --> 00:02:03,09 But, when Mac users work in the terminal or exchange files 57 00:02:03,09 --> 00:02:05,04 with users of other platforms, 58 00:02:05,04 --> 00:02:08,02 the DS store files are more evident. 59 00:02:08,02 --> 00:02:10,04 As long as we don't, actually, need the DS store files 60 00:02:10,04 --> 00:02:12,04 and the customizations they represent, 61 00:02:12,04 --> 00:02:14,05 one strategy we can use to get rid of these files 62 00:02:14,05 --> 00:02:17,03 in a given folder or on a shared disc, or something, is 63 00:02:17,03 --> 00:02:21,08 to run find.-name .DS store-delete. 64 00:02:21,08 --> 00:02:23,05 And usually, if we're exchanging files 65 00:02:23,05 --> 00:02:24,09 with someone on a different platform, 66 00:02:24,09 --> 00:02:25,09 we don't need these files, 67 00:02:25,09 --> 00:02:27,09 because they can't really use them anyway. 68 00:02:27,09 --> 00:02:30,02 Finder will often regenerate these though, 69 00:02:30,02 --> 00:02:32,04 so this procedure is best done as a final step 70 00:02:32,04 --> 00:02:35,00 in preparing a shared disc for distribution. 71 00:02:35,00 --> 00:02:37,01 There are also other tricks for handling these files 72 00:02:37,01 --> 00:02:38,07 in various scenarios. 73 00:02:38,07 --> 00:02:40,08 For example, we can add a pattern for these files 74 00:02:40,08 --> 00:02:42,05 to a .gitignore file, if we're working 75 00:02:42,05 --> 00:02:45,01 with a Git repository that ends up containing some 76 00:02:45,01 --> 00:02:46,05 of these files. 77 00:02:46,05 --> 00:02:49,04 And, various file server protocols can suppress these files 78 00:02:49,04 --> 00:02:51,03 from being created or from being shown 79 00:02:51,03 --> 00:02:52,08 at the server level. 80 00:02:52,08 --> 00:02:54,05 Each user can, also, instruct their Mac 81 00:02:54,05 --> 00:02:56,09 to not create these files on network shares 82 00:02:56,09 --> 00:02:58,08 with the terminal command defaults 83 00:02:58,08 --> 00:03:00,09 write com.apple.desktopservices 84 00:03:00,09 --> 00:03:04,03 DSDon'tWriteNetworkStores true. 85 00:03:04,03 --> 00:03:06,06 DS store files do contain some information that can 86 00:03:06,06 --> 00:03:07,07 be sensitive. 87 00:03:07,07 --> 00:03:10,00 Information, like the names of files in a directory. 88 00:03:10,00 --> 00:03:12,06 Along with other information that's usually less sensitive, 89 00:03:12,06 --> 00:03:14,08 like, whether the Finder window should show a column or 90 00:03:14,08 --> 00:03:17,06 a list view, which tool bars to show, and so on. 91 00:03:17,06 --> 00:03:19,06 While these files are mostly just annoying debris 92 00:03:19,06 --> 00:03:22,08 to non Mac users, if we get our hands on a DS store file, 93 00:03:22,08 --> 00:03:25,03 we can peek inside with a text editor or other program 94 00:03:25,03 --> 00:03:27,05 to see what we can find. 95 00:03:27,05 --> 00:03:28,08 Like Apple double files. 96 00:03:28,08 --> 00:03:31,00 These DS store files are often referred 97 00:03:31,00 --> 00:03:34,03 to as junk by Mac users and non Mac users alike, 98 00:03:34,03 --> 00:03:36,02 because they appear to litter the file system 99 00:03:36,02 --> 00:03:38,07 with useless files, but they have their purpose 100 00:03:38,07 --> 00:03:39,09 and they're a fairly durable way 101 00:03:39,09 --> 00:03:41,07 of ensuring that user customizations 102 00:03:41,07 --> 00:03:44,03 for Finder can persist locally and aren't lost, 103 00:03:44,03 --> 00:03:47,00 when writing files to non Apple file systems.