File Writing

Hello,

I’ve searched the wiki before anyone says ‘use the wiki’. It has nothing about this, I think xD

So I want to write a file, a .txt to a specific folder.

[LUA]
file.CreateDir( “test” )
file.Write( “test.txt”, “Hello” )
[/LUA]

That’s my test code. Here is the wiki. http://wiki.garrysmod.com/page/file/Write If anyone could help me write that .txt to the directory created above that would be awesome!

I know that when I create the directory it’s created in the data folder and I know file.Write by default writes to the data folder.

Thanks, Munch

Huh, aren’t you familiar with file paths at all?



file.CreateDir("somedir")
file.Write("somedir/test.txt", "Abcdef")


Thank you very much!