private void startRecording ( String line , DispatchCallback callback ) { OutputFile outputFile = sqlLine . getRecordOutputFile ( ) ; if ( outputFile != null ) { callback . setToFailure ( ) ; sqlLine . error ( sqlLine . loc ( "record-already-running" , outputFile ) ) ; return ; } String filename ; if ( line . length ( ) == "record" . length ( ) || ( filename = sqlLine . dequote ( line . substring ( "record" . length ( ) + 1 ) ) ) == null ) { sqlLine . error ( "Usage: record <file name>" ) ; callback . setToFailure ( ) ; return ; } try { outputFile = new OutputFile ( expand ( filename ) ) ; sqlLine . setRecordOutputFile ( outputFile ) ; sqlLine . output ( sqlLine . loc ( "record-started" , outputFile ) ) ; callback . setToSuccess ( ) ; } catch ( Exception e ) { callback . setToFailure ( ) ; sqlLine . error ( e ) ; } }
Start writing to the specified record file .