Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How Do You Create A File?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
riveryu




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Clayton




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: