- Home /
Access Windows Shared Folder on Mac
I am trying to extend a Windows platform project to work on a Mac Platform. The preferred language is C#. The project accesses a shared network folder on a Windows machine. It pulls data files from the folder for use at run-time.
When running the project on the Windows platform, I can use the Directory.Exists() and other Directory/File related functions without a problem with the path "\\\\computername\\sharedfoldername\\". On the Mac platform, the function Directory.Exists() returns false. The path separators are changed to the OS appropriate version using "Path.DirectorySeparatorChar". As a test, if the files are stored locally on the Mac, the code in place is able to access the files. To me, it seems like the issue is either the syntax of the path given to the function or something not taken into account to allow this method in Unity on the Mac.
I have been trying to determine what is the proper syntax that a mac would use for this function when accessing a Windows shared folder on the local network. The folder does exists and the Mac can the folder in finder with the line "smb://computername/sharedfoldername/". I mounted the share folder successfully in Finder, but that had no effect on the issue. The Windows platform is Windows 7. The Mac OS is OSX 10.6.7.
The WWW class is used in many cases in our program for the actual downloading of user files, however what I need is a way for the user to browse for files and upload files. I need to supply them with a way to count files in a directory, move up and down directories, and see a list of the files in the directory. If there is no way to do this within reason, it will bring the project on the Mac to a halt.
Any solution at all would be fantastic. Although not my first choice, steps can be taken outside the Unity program if necessary to facilitate the functionality I need for the project.
Answer by dasshawn · Mar 08, 2012 at 04:43 PM
As far as I could determine, I HAVE to mount the Windows drive on the Mac. Then use the "Where" location (in the info pane for the mounted shared folder) for the shared folder that was mounted. Then I could access it like any other folder, just like the Windows version does. This may not be the best solution but it does work.
Your answer
Follow this Question
Related Questions
EditorUtility.OpenFilePanel uses \ FileInfo.Name uses / 0 Answers
Opening file Library/FailedAssetImports.txt failed because permission for the file was denied 0 Answers
Why is Unity identifying my computer as both a Windows and a Mac? 1 Answer
How to write files to the streaming asset folder in Android at runtime 1 Answer
Creating a Directory in "My Documents" 2 Answers