Skip to content

FileReadWriter provide easy way to read/write file. Ex, when output path has not existing directory, it will be created.

License

Notifications You must be signed in to change notification settings

midgithub/CS_FileReadWriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS_FileReadWriter

FileReadWriter provide easy way to read/write file. Ex, when output path has not existing directory, it will be created.

NOTE: This project is made by Unity, but it FileReadWriter.cs works on a native C#.

Import to Your Project

Unity

You can import this asset from UnityPackage.

C#

Import FileReadWriter/FileReadWriter.cs to your project.

How to Use

FileReadWriter.cs is static class. So you can call any method from any place.

public string filePath = "~";
public string fileContent = "Sample";
protected string result = "";

result = FileReadWriter.ReadFile(filePath).content;
result = FileReadWriter.WriteFile(filePath, fileContent).content;

Default encoding is UTF-8 but you can change the encoding with argument if you need.

And in default, When output path has not existing directory, it will be created. This is useful to avoid Not found exception. Also this setting is enabled to change with argument too.

About

FileReadWriter provide easy way to read/write file. Ex, when output path has not existing directory, it will be created.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages