Filename and mode are the same as in fopen( ) ( mode defaults to 'w' ) , connection specifies the connection to trace and defaults to the last one opened .