Author |
Message |
riveryu

|
Posted: Wed Feb 27, 2008 7:35 pm Post subject: 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? |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
Posted: Wed Feb 27, 2008 7:41 pm Post subject: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
Clayton

|
Posted: Wed Feb 27, 2008 9:01 pm Post subject: 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
|
Posted: Wed Feb 27, 2008 9:31 pm Post subject: 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

|
Posted: Wed Feb 27, 2008 10:50 pm Post subject: 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

|
Posted: Thu Feb 28, 2008 12:06 am Post subject: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
|