Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by CyberTurboPlays · Nov 06, 2014 at 04:08 PM · saveloadfilestreamdevices

System.IO.IOException: Win32 IO returned 25?anyone

ok, i really have no idea on how to save myself now, plz help! i got my save/load feature which use filestream to write/read file to/from drive. everything working as expected both on my PC and device, then i move onto add in all the ad networks and google play into my game. and after that, i realize my save feature has broken now on my device, but still ok on my PC i check in adb, and when the save happen, "System.IO.IOException: Win32 IO returned 25" was printed.

my save was fine before i added in those ads plugs, where there was no android manifest file in my Unity project. but even when i have the manifest file in my project now, i sure have added in all the read write permission explictly in it

has this got anything to do with my android manifest and/or the jar file that is got imported in/created when adding in the ads plugs?

please help me out on this

Comment
Add comment · Show 1
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 CyberTurboPlays · Nov 07, 2014 at 01:58 PM 0
Share

why on earth the two file path output string are different? even when they are pointing to the same location on device

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by CyberTurboPlays · Nov 10, 2014 at 03:18 PM

just for the sake of record, i will update this post 1 last time, and it will be an answer to my own.

i hav completely over come this issue by simply change from this:

 Directory.CreateDirectory(Application.dataPath + "\\DotData")

to this:

 Directory.CreateDirectory(Application.dataPath + "/DotData")

when with Directory.CreateDirectory(Application.dataPath + "\\DotData") , PC and Device can create dir no problem, as long as android.permission.WRITE_EXTERNAL_STORAGE is not asked.

and now with Directory.CreateDirectory(Application.dataPath + "/DotData") , both PC and device will create the same dir like before, but this one works OK, even when android.permission.WRITE_EXTERNAL_STORAGE is asked on device.

another little question comes to mind rightaway, why would anyone wanted to use "\\" rather than "/"? the reason why i used was i saw most of the example code when creating dir and/or file would use "\\". what do you say? when do you use "\\" and when for "/"

anyway, thx Unity, for giving me a place to finally answer to myself, great kudo to you

Comment
Add comment · Show 1 · 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 tessellation · Jun 17, 2021 at 05:07 AM 0
Share

You should use:

 Application.persistentDataPath + Path.DirectorySeparatorChar + "DotData"
avatar image
0

Answer by Bunny83 · Nov 06, 2014 at 04:23 PM

IO Error 25 probably means that you're reached the end of the file. So you either try to read more data than there is, or for some reason you can't write the file (maybe out of space?).

I guess it's the reading case and it's either because you didn't serialize the data in a way it can be resored reliably or the data you want to read is in an outdated format. Since you said you changed / added stuff it's most likely a version conflict between your save data and your current implementation.

Comment
Add comment · Show 8 · 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 CyberTurboPlays · Nov 06, 2014 at 04:58 PM 0
Share

i go back to the apk which was built when there is no ad not even android manifest in my Unity proj (the pure game built) and test. adb return : I/Unity ( 2000): /data/data/com.CyberTurboPlays.DragFaster/files/DotData/CTPDotData.Tgd Saved

the problem one is like: I/Unity (31976): IOException: Win32 IO returned 25. Path: /storage/sdcard0/Android/data/com.CyberTurboPlays.DragFaster/files/DotData I/Unity (31976): at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in :0 I/Unity (31976): at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in :0 I/Unity (31976): at TBF_SaveLoad.TB_Save () [0x00000] in : 0

any thought ?

avatar image CyberTurboPlays · Nov 07, 2014 at 04:50 AM 0
Share

anyone plz help, i m still stuck here

avatar image Graham-Dunnett ♦♦ · Nov 08, 2014 at 05:12 PM 1
Share

Um, so the two file paths are different. One is pointing to the internal storage, the other to the storage card. $$anonymous$$aybe one of the plugins you are using is telling Android that the app uses the storage card. $$anonymous$$aybe you've written to the internal storage, but are trying to read from the storage card? What is baffling is why the Android device is issuing Win32 IO errors. $$anonymous$$akes no sense to me. Strange that the error comes from directory creation code. Are you expecting to create directories?

avatar image CyberTurboPlays · Nov 09, 2014 at 07:12 AM 0
Share
         public void TB_Save()
         {
             if (!Directory.Exists(Application.dataPath + "\\DotData"))
             {
                 Directory.CreateDirectory(Application.dataPath + "\\DotData");
             }
             string filePath = Application.dataPath + "\\DotData\\" + "CTPDotData.Tgd";
             FileStream FS = new FileStream(filePath, File$$anonymous$$ode.Create);
             XmlSerializer XS = new XmlSerializer(typeof(TBF_SaveLoad));
             XS.Serialize(FS, this);
             FS.Close();
             Debug.Log(filePath + " Saved");
         }
avatar image CyberTurboPlays · Nov 09, 2014 at 07:14 AM 0
Share

yeah, i m creating a directory with the save. but everything is ok when there is no "android.permission.WRITE_EXTERNAL_STORAGE".

i m not absolutely sure tho, but i think android internal storage means sdcard0, where as sdcard1 is the external card

Show more comments

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

Saving and loading with Filestream www, doesn't work when i build my game 0 Answers

Missing FileStream constructor(s): FileStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync); 1 Answer

Why is my FileStream constructor throwing an exception for an overlapped HID device 'file' handle? 1 Answer

searching particular word in text file.? 0 Answers

How to handle frame rate drop 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