Jump to content

path for filewriter?


Chris_C

Recommended Posts

without a path (just a filename) not surprisingly I get an error !

how do I get a path I'm "supposed" to use?

do I need to ensure a directory is created (inside plugindata ?)

IOException: Sharing violation on path /home/chris/.local/share/Steam/SteamApps/common/Kerbal Space Program/PluginData/mscorlib/map.csv
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
at System.IO.StreamWriter..ctor (System.String path) [0x00000] in <filename unknown>:0
at KSP.IO.TextWriter.CreateForType[String] (System.String filename, .Vessel flight) [0x00000] in <filename unknown>:0

TIA ;)

Link to comment
Share on other sites

No, the directory is determined by the assembly name of the class you feed TextWriter on initialisation.

Sharing violation sounds like you've either got it open in another application or you're accidentally opening multiple streams on the same file at the same time (you can use multiple streams sequentially as long as you Close() one before opening another).

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...