Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
create empty .txt file #429751
09/17/13 22:20
09/17/13 22:20
Joined: Oct 2010
Posts: 73
0110111
C
CodeMaster Offline OP
Junior Member
CodeMaster  Offline OP
Junior Member
C

Joined: Oct 2010
Posts: 73
0110111
how create a empty .txt file in my working folder?
i can't find this function in the manual

Re: create empty .txt file [Re: CodeMaster] #429753
09/17/13 22:38
09/17/13 22:38
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Code:
// returns non-zero on success, zero on failure.
fixed create_empty_file(STRING* fname)
{
   if (fname == NULL)
      return 0;

   fixed handle = file_open_write(fname);

   if (handle)
      file_close(handle);

   return handle;
}



Always learn from history, to be sure you make the same mistakes again...
Re: create empty .txt file [Re: CodeMaster] #429754
09/17/13 22:48
09/17/13 22:48
Joined: Nov 2005
Posts: 204
Bavaria
HellThunder Offline
Member
HellThunder  Offline
Member

Joined: Nov 2005
Posts: 204
Bavaria
Hi!

Here is the link to the Manual. Yay it is a Little bit hidden.
http://www.conitec.net/beta/afile_open_read.htm

Code:
file_open_write (STRING* name);

or
Code:
file_open_append(STRING* name);


will do it.


But you can also use <stdio.h> for manipulate files.
Code:
FILE *document = fopen("FileName.txt", "w");


Here is a reference
http://www.cplusplus.com/reference/cstdio/


Create your own JRPG and join our community: https://www.yrpgtoolkit.com
Re: create empty .txt file [Re: Uhrwerk] #429755
09/17/13 22:54
09/17/13 22:54
Joined: Oct 2010
Posts: 73
0110111
C
CodeMaster Offline OP
Junior Member
CodeMaster  Offline OP
Junior Member
C

Joined: Oct 2010
Posts: 73
0110111
thanks to you i just noticed in manual if the file does not exist, it is created with file_open_write

thanks, problem is solved laugh


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1