Anyway to write and read a raw file?Solved
TactiTac0z

There is the DateFileSystem whitch is super usefull but in this case I just want to write a simple text file.

I assume that the most of System.IO is blocked.

I've quckly skimmed the docs and it doesn't seem like the umod api got anything?


upcause I chould just Interface.Oxide.DataFileSystem.WriteObject<string>(filename, str);

and that is what I've right now but upcause that escabes newlines witch is not what I want in my textfile.

Wulf
uMod Admin
Not at the moment, we only provide a wrapper for JSON files. For anything else, you’d have to write and extension.
TactiTac0z
Original Poster
In response to Wulf (View post):
Not at the moment, we only provide a wrapper for JSON files. For anything else, you’d have to write...

Ohhh danm, The reson why I wanted to do this was because I have this command called /adminhelp its ment to be used by players to ask questions while I'm not online, right now its saved in a common json file, and is read by an admin command.

I thouth it would be simplere to save it as a raw text file insted and then use the Append write method to not let it effect ram.

I want it to be a file I would nerver clear or delete.

If I would have to use the Datefilesystem I would have to load the hole file into ram evreysingle time, witch would eventuelly kill the ram ):

You got any ideas?

Wulf
uMod Admin
You could always load it, save it, and then null it.
TactiTac0z
Original Poster
Yeah but the file would take up ram in the couble of secounds it exists then.
The file would eventuelly get big enouth and so the file gets bigger then the available ram.
2CHEVSKII
Plugin Developer
In response to TactiTac0z (View post):
Yeah but the file would take up ram in the couble of secounds it exists then.
The file would ev...

Can you imagine a file big enough to take atleast 1MB? I doubt your players can write so many questions in a year.

It's your business, but I highly unrecommend wasting time on optimization in this case, it's just useless.

TactiTac0z
Original Poster
In response to 2CHEVSKII (View post):
Can you imagine a file big enough to take atleast 1MB? I doubt your players can write so many questi...

Ohhh my friend.. You've no idea... lol

But just out of ceriosity 1KB is 1000 bytes right? and 1MB is 1 million bytes..

(While writeing this I recall how much mordern memory standards are)

But Strings in C# ussially uses a unicode format right? So in the worst case senario a letter chould take up to 2-4 bytes.

and sence my server ussaliy only got about 1000 to 1400 KB memory available and that poeple ussially write messages between 5 and 20 letters of leanth Poelpe whould have to write like 10000 ish messages to get even close to kill the ram... ok fine, I supose it won't be an issue for a while... (ok not counting that I would have to save a name and timestamp)

Keep in mind when I wrote the messages above I forgot how high the memory standards are nowadays...

Merged post

Last time I worried about ram I was programming a minecraft computercraft computer they only got like 1-2K XD.

I'm sure at least one of you can relate to that...


Merged post

OK currection its opencomputers computers that got no ram what so fuckin ever...