x


pathname slash/backslash

Hello,

after building my game (windows standalone), it doesn't work because there are information and data missing which are in the executablename_Data/Resources folder. I try to get access to this data with Application.dataPath + "/Resources/fileName.xml. It works only if i copy&paste the xml manually into this folder after the build.

How to solve this problem: "Note that the string returned on a PC will use a forward slash as a folder separator." http://unity3d.com/support/documentation/ScriptReference/Application-dataPath.html

The path I get with application.dataPath is like: C:/.../.../executablename_Data but on windows it has to be C:\...\...\executablename_Data

more ▼

asked Sep 19 '11 at 04:31 PM

Isa gravatar image

Isa
1 2 2 3

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You don't need to use backslashes even on Windows, just forward slashes.

more ▼

answered Sep 19 '11 at 05:06 PM

Eric5h5 gravatar image

Eric5h5
80.2k 41 132 519

In my reader script I have a Debug.Log if the file can't be opened: "Error opening: " + pathToFile + " for reading." And i get this message in the output.log with the pathname in it. With forward slashes. Error opening: C:/.../.../.../... for reading. But if i click on the file and check the path, it's with backslashes. Is this the problem why it can't open the file?

Sep 20 '11 at 08:26 AM Isa

no, it is not

Sep 20 '11 at 08:48 AM japanitrat
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x656
x237
x218

asked: Sep 19 '11 at 04:31 PM

Seen: 1053 times

Last Updated: Sep 20 '11 at 08:48 AM