The code below creates the file, but is not writing data to it.
p=outfile("outfile.txt" "w")
fprintf(p "write to out file")
The code below creates the file, but is not writing data to it.
p=outfile("outfile.txt" "w")
fprintf(p "write to out file")
Cadence uses buffered IO for files, so to see your output you will need to explicitly flush the port like so:
drain(p)
The port will also get automatically flushed when you close it, so this is only necessary if you want to see intermediate output.