Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have Mac (OSX Lion) and PC (Windows 7) with a shared folder. To mount Windows shared folder I use "Connect to Server" in Finder. All files and folders are copied ok except for the files that begin with dot (e.g .htaccess). In Windows these files are created with hidden attribute.

How to copy file/folder beginning with dot without hidden attribute?

share|improve this question
    
At the risk of asking the obvious - have you only examined the shared folder in the Finder, or have you looked at the file (or shared directory) in a terminal window? If you do not have hidden files set to visible in the Finder (most people don't) you won't be able to see hidden files. On another note, while files such as .htaccess can surely be important, others are not as they simply contain information about the directory's structure. –  soxman Feb 26 '12 at 16:34
    
I often work with dot files therefore they are visible in Finder (defaults write com.apple.finder AppleShowAllFiles TRUE). If I copy dot file/folder to a shared directory it is marked as hidden in Windows. I need it not to be hidden. –  placeba Feb 26 '12 at 19:27
    
Just so I fully understand here: you need the file to (a) keep the dot prepended and (b) be visible in the shared directory on your Mac (as it is in other directories). Do you need these attributes on the Windows machine as well ("invisible," yet "visible")? –  soxman Feb 26 '12 at 20:23
    
I need the files to be visible in Windows without hidden attribute. However, after being copied from Mac all the files beginning with dot have hidden attribute. Please note that in Windows dot files are not hidden by default. –  placeba Feb 26 '12 at 20:42
    
According to your last comment, the solution must be applied on the Windows side and not the Mac. The solution would be to show hidden files/folders in windows, which I thing it is under the Options->View... if I am correct. –  ismail Feb 26 '12 at 23:06

2 Answers 2

So here is the answer:

  1. Navigate to /etc/
  2. Use any text editor to open smb.conf for editing. You will have to use administrator credentials e.g.,
    sudo vi smb.conf
  3. Under the [global] section of this file, add the following
    hide dot files = no
  4. Save the file. Your problem should be solved from there.
share|improve this answer
    
File /etc/smb.conf doesn't exist. I created this file, wrote hide dot files = no and restarted my mac. Also I found another smb.conf (/var/db/smb.conf) and did the same manupulations. None of these steps solved my problem. –  placeba Feb 28 '12 at 19:50
    
For the test purpose I mounted windows shared folder in Ubuntu and copied dot files. The files were created without hidden attribute. –  placeba Feb 28 '12 at 19:59
    
Are you running Lion? I just realized that was never made clear before. Apple removed Samba from Lion in favor of a native protocol that I am unfamiliar with (still running Snow Leopard). At this point (a) I would advise you to remove the smb.conf file you created as it is useless without Samba (b) add the info that you are running Lion to your OP to make sure you get relevant answers/info, and (c) I am bowing out since I am not running familiar with the new Windows sharing protocol in Lion. Good luck. –  soxman Feb 28 '12 at 21:05

Let's assume for this example that your ".htaccess" file is located in the root directory of your mounted Windows share. Let's also say the Windows volume is called "WindowsShare". Finally, let's say you want to copy this file to your Desktop.

Open Terminal. Type in cd /Volumes/WindowsShare. Then type in cp .htaccess ~/Desktop. You can modify this as needed based on your file locations and file names.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.