[Csnd] Write a .txt file

Hello everybody!

Is there a function in csound to create a text file from scratch?
i don’t want to write in it, just create if filevalid is 0 and to use it after the init phase.

Greetings,
Philipp
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

fiopen

Prof. Victor Lazzarini
Maynooth University
Ireland

Thanks Victor!

Now, related to the first question, i want to know if i can delay the #include of the same file. is this possible in some kind of way?
i do this

instr file_validity
  iValid filevalid "midi-presets.txt"
  
  if iValid == 1 igoto skip
    print iValid
    iFile fiopen "midi-presets.txt", 0
  skip:
  turnoff
endin

and later i do the #include „midi-presets.txt". but when i start csound the files does not exist yet. but i guess the #include is part of the preprocessor, so this is happening even before the init phase.

Or is there a way around this?

Greetings,
Philipp

Instead of #include, perhaps use compileorc ?

Thorin

I guess you can try recompiling the code

[

compileorc
csound.com

](compileorc)

instead of including

Prof. Victor Lazzarini
Maynooth University
Ireland