1

The code below creates the file, but is not writing data to it.

p=outfile("outfile.txt" "w")
fprintf(p "write to out file")
RJFalconer
  • 10,890
  • 5
  • 51
  • 66

1 Answers1

1

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.

Ian St.John
  • 311
  • 3
  • 6