Is there a way to get the final path to the oxide data folder/data file? like C:/rustserver/server/myid/oxide/data/test.json
Solved Get plugin configs path
Discussion in 'Rust Development' started by JMteam09[JMH][DEV], Nov 10, 2015.
-
Wulf Community Admin
What are you wanting to do with the path?
-
@Wulf reading the config to send its contents as string to a website (my own) instead of using mysql for connection
-
Wulf Community Admin
You don't need to get the full path for that, just use the Config/Datafile API in Oxide.
Oxide/DynamicConfigFile.cs at master · OxideMod/Oxide · GitHub
Oxide/DataFileSystem.cs at master · OxideMod/Oxide · GitHub -
Wulf Community Admin
-
[DOUBLEPOST=1447179610][/DOUBLEPOST]@Wulf can you send a preview?Last edited by a moderator: Nov 10, 2015 -
Wulf Community Admin
I don't have much experience with config objects, so I'm not sure. -
@Wulf oxide should have acces to read/write files within the server path (virus safe, if you exclude the Managed folder -- with all the dlls).
then you could add a function like WriteFile(String foldername(<- you can directly check if you want to gain acces to a folder), string filepath); -
Wulf Community Admin
-
@Wulf ist it possible at then for you guys to fix it like you can use
Code:Interface.GetMod().DataFileSystem.ReadDataFile(String name) (returns the content of the file)
-
Wulf Community Admin
-
@Wulf i dont mean get it as a table but as a string just like you could use System.IO.File.ReadAllText(String path);
-
Wulf Community Admin
-
@Wulf well i can use that
thanks
-
@Wulf this here can save the day:
Code:Puts(Interface.GetMod().DataFileSystem.ReadObject<JObject>("Reconomy").ToString());
-
but it will have a timestamp in front of the message. -
@LaserHydra but in general id try to get the config content as string