Access to File System

I have 3 elementary questions to try and understand a few basic concepts:

  1. In simple terms, what does it mean:

A Unity web application does not have direct access to the file system.

  1. Does it alsoapply to a standalone that has been built (and you are using it and running it on your machine)?

  2. If you have a Unity application that is running on your machine, can you save stuff locally? For example, I have written a few C# scripts and now have a psychology experiment that measures reaction times when a user sees a digit and hits the space bar. I use print statements to see the reaction times at the Console. How do I write and save these results (e.g. reaction times) to a file on my machine for processing ad analyzing, etc…?

in future, please limit each question to a single question. …or is that part of a psych test? :wink:

to answer them:

  1. web applications are sandboxed (for security reasons) within the browser so it’s not possible to access the local file system of the device on which the app is running.

  2. no, but depending on the device there may be other limitations.

  3. yes, but see #2.

You can use unity’s built in JSONUTILITY class to define a reaction time class and write it to the Streaming assets path so you know it’s always there regardless of platform.
I.e.

  1. create a class that stores the reaction time as a float ( and any more details you want.)
    2)Use JSONUTILITY.toJson to convert it to a JSON code string
  2. use the IO Header to write to application.streamingAssetPath