
-----------------------------------
riveryu
Wed Feb 27, 2008 7:35 pm

How Do You Create A File?
-----------------------------------
How Do You Create A File? I know theres File.Delete but how do you create one in a turing program?

-----------------------------------
Tony
Wed Feb 27, 2008 7:41 pm

RE:How Do You Create A File?
-----------------------------------
if you open a file for writing, that does not exist, I think it will be created for you.

-----------------------------------
Clayton
Wed Feb 27, 2008 9:01 pm

RE:How Do You Create A File?
-----------------------------------
What Tony says is correct. Simply write to that file and voila! Your file will have been created.

-----------------------------------
that-guy
Wed Feb 27, 2008 9:31 pm

RE:How Do You Create A File?
-----------------------------------
the code for it would look like this:

var fn : int
var fileName : string := "Example.txt"

open : fn, fileName, put
put : fn, "This is an example"
close : fn

Doing this will create a file in the directory where your turing file is saved.

-----------------------------------
riveryu
Wed Feb 27, 2008 10:50 pm

RE:How Do You Create A File?
-----------------------------------
wow thx guys ! 

I made a program that creates random useless files in various locations of Windows XP computers. With names that mimic popular applications and contains my essays about  various aspects of Chaos Theory with swearing.

Juz for practice, (no harm done to anybody in the proccess)

Does Turing contain any other built in fcn/proc that can edit file types other than txt?

-----------------------------------
Tony
Thu Feb 28, 2008 12:06 am

RE:How Do You Create A File?
-----------------------------------
all the files are in a way the same, the extension just suggests how to interpret the data.

instead of put and get, look into write, read and seek for random access.
