Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At work I'm using a windows box with local and network drives. One of drives I have mapped is my Linux home directory (We have separate windows and linux accounts and home directories here). When I view it from windows, all of the files and folders beginning with . are shown, as would be expected. (Although . and .. aren't in any folder)

Just wondering if there is a way to tell windows to not show anything starting with a dot. I was hoping there's a registry entry or something that defines what a 'protected operating system file' is, so I could put dot files in the same category as thumbs.db etc.

share|improve this question
Anyone know the answer to the second half of the question? I just encountered a folder (shared via samba, with my non-dot files - not OS files) which appeared empty until I selected "show protected operating system files". Why are these being flagged as such? – jmanning2k Apr 6 '11 at 19:13
up vote 4 down vote accepted

If you have access to the smb.conf file on the Linux machine, add the following line to the individual file share's configuration:

hide dot files = yes

That will make Samba report all files starting with a dot as having the Windows "hidden" attribute, so they will not appear unless you enable hidden files display in Windows Explorer.

share|improve this answer
Hmmm. I'm only an intern here so I don't really want to go fiddling with settings that aren't specific to just my account/computer. Also, I'd like to be able to view hidden files, but not dot files, which is why I asked if the files could be put in the same category as thumbs.db. – Cam Jackson Apr 7 '11 at 3:03
@CamJackson: Those files are identified by the NTFS "System" attribute, which is applied to to each Windows system file upon install and other files like thumbs.db by the shell on creation. You can use the attrib command to set that attribute on local files, and presumably on Windows servers. But, it has no effect on Samba servers (I just tested it to be sure!), because the underlying file system on Unix machines doesn't support it. Unfortunately, that means the only way to set attributes like hidden and system is to configure Samba to emulate them in its connections. – Patches Apr 7 '11 at 3:28
Right, yeah, that makes sense. So I guess the only perfect solution would be if samba were to add an extra option like 'protect dot files = yes'. I'll come back and rate this up once I can! – Cam Jackson Apr 7 '11 at 5:26
@CamJackson: Another option is to prevent dot files from being shared at all with the veto files option. That prevents files from being visible or accessible on a Samba share, as if they didn't exist. Just add veto files = .* to the share configuration. If you decide to do this, make sure you read the linked information about that option, as there are several important caveats you need to be aware of. – Patches Apr 7 '11 at 5:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .