Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by spacepilot · Dec 24, 2011 at 03:31 PM · filedata

writing to file

Just found FileUtil.ReplaceFile in the documentation. I know unity accepts web-addresses in path-names which should make downloads possible with that command. Is there also a way to save (raw-)data with a similar method? E.g. saving some variable's content to standard-filetypes.

Syntax:

  • static function ReplaceFile ( src : String, dst : String ) : void

In other words: Is there a way to refere to some kind of internal data with the src-string?

Thanks in advance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by CursedScripter · Dec 24, 2011 at 03:51 PM

http://answers.unity3d.com/questions/181172/dat-file-location.html

I think you mean something like that

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by spacepilot · Dec 24, 2011 at 05:41 PM

I saw the other post already - they use some standard-.NET-method to write to a file. AFAIK it has two disadvantages:

  • It cannot be used in standard-scripts (only in editor-scripts, please correct me if I'm wrong)

  • It only writes txt-files (one line at a time)

You cannot output non-.txt-files with that, even though they gave their file a .dat-extension in the example. What I wanna do is using unitys copy-function for files to copy a data-stream instead of a file. So instead of a file-path I wanna give it something else. In linux-world they use the "|" (pipe-symbol) and block-devices for things like that. So my question is what else can I use as pathname? Are there special system-variables or keywords I can use?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image spacepilot · Dec 25, 2011 at 10:09 AM 0
Share

Here, someone is using a library called System.io with the command

 import http://System.IO; 

So obviously someone used a webaddress ins$$anonymous$$d of a pathname to refer to some internal library. I think the idea is close that something like this also works with the copy-function and not only with import. So how can I dump raw-data to a file in unity?

avatar image spacepilot · Dec 29, 2011 at 03:57 PM 0
Share

These guys here have had a similar threat: Implement file-compression. Unfortunately it's hard to understand what they are actually talking about. Example:

Using the System.IO.Compression.GZipStream classes results in the dreaded DllNotFoundException: $$anonymous$$onoPosixHelper exception

All I understand is that they also use System.IO to make their compression possible somehow. In a linked threat in the mentioned one, someone writes:

the reason for this failure is not so much the old mono version shipped with Unity 2.6.1, but rather that $$anonymous$$ono implements System.IO.Compression.GZipStream not with a managed implementation, but it relies on a system installed zlib ins$$anonymous$$d.

...so System.IO is some-kind of mono-class with sub-components (here Compression.GZipStream). I don't understand why this website claims System.IO to be a .NET-class. The link is from the compression-threat as well: Using GZipStream for Compression in .NET

So where can I look up this System.IO and what is it anyway? Can I also refere to other things in the same way as with http://System.IO?

Edit2: It seems it's a forums-system-bug: System. I O always gets replaced with http://System.io here. So maybe there is no way to refere to local, internal sources with a webaddress in unity. Would like to get some reply on this. Thank you.

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Facebook cannot find my Unity data file. 1 Answer

[Closed] Place to store user data 1 Answer

Convert Android URI to a file path Unity can read 2 Answers

Out put data from web version 2 Answers

How do i make it so the data and playerprefs and everything necessary in the game is in the exe file? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges