Develop and Download Open Source Software

Browse CVS Repository

Diff of /ttssh2/teraterm/source/teraterm/filesys.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by yutakakn, Sat May 7 09:49:24 2005 UTC revision 1.6 by maya, Mon Aug 28 12:27:16 2006 UTC
# Line 238  void LogStart() Line 238  void LogStart()
238    
239          if (strlen(&(LogVar->FullName[LogVar->DirLen]))==0)          if (strlen(&(LogVar->FullName[LogVar->DirLen]))==0)
240          {          {
241                    // LOWORD
242                    // 0x0001 = Binary
243                    // HIWORD
244                    // 0x0001 = Append
245                  // 0x1000 = plain text (2005.2.20 yutaka)                  // 0x1000 = plain text (2005.2.20 yutaka)
246                    // 0x2000 = timestamp (2006.7.23 maya)
247                  // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)                  // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)
248                  Option = MAKELONG(ts.TransBin,ts.Append | (0x1000 * ts.LogTypePlainText));                  Option = MAKELONG(ts.TransBin,ts.Append |
249                                                      (0x1000 * ts.LogTypePlainText) |
250                                                      (0x2000 * ts.LogTimestamp));
251    
252                    // ログのデフォルトファイル名を設定 (2006.8.28 maya)
253                    strncat(LogVar->FullName, ts.LogDefaultName, sizeof(LogVar->FullName));
254                    ParseStrftimeFileName(LogVar->FullName);
255    
256                  if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))                  if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))
257                  {                  {
258                          FreeFileVar(&LogVar);                          FreeFileVar(&LogVar);
# Line 255  void LogStart() Line 267  void LogStart()
267                  } else {                  } else {
268                          ts.LogTypePlainText = 0;                          ts.LogTypePlainText = 0;
269                  }                  }
270    
271                    if (ts.Append & 0x2000) {
272                            ts.LogTimestamp = 1;
273                    }
274                    else {
275                            ts.LogTimestamp = 0;
276                    }
277    
278                  ts.Append &= 0x1; // 1bitにマスクする                  ts.Append &= 0x1; // 1bitにマスクする
279    
280          }          }
# Line 430  void LogToFile() Line 450  void LogToFile()
450          {          {
451                  if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag))                  if (((cv.FilePause & OpLog)==0) && (! cv.ProtoFlag))
452                  {                  {
453                            // 時刻を書き出す(2006.7.23 maya)
454                            // 日付フォーマットを日本ではなく世界標準に変更した (2006.7.23 yutaka)
455                            if (ts.LogTimestamp &&
456                                    (Start == 1 || Buf[Start-2] == 0x0a)) {
457    #if 0
458                                    SYSTEMTIME      LocalTime;
459                                    GetLocalTime(&LocalTime);
460                                    char strtime[27];
461    
462                                    // format time
463                                    sprintf(strtime, "[%04d/%02d/%02d %02d:%02d:%02d.%03d] ",
464                                                    LocalTime.wYear, LocalTime.wMonth,LocalTime.wDay,
465                                                    LocalTime.wHour, LocalTime.wMinute, LocalTime.wSecond,
466                                                    LocalTime.wMilliseconds);
467    #else
468                                            time_t tick = time(NULL);
469                                            char *strtime = ctime(&tick);
470    #endif
471    
472                                    // write to file
473                                    if (Start == 1 && ts.Append) {
474                                            _lwrite(LogVar->FileHandle,"\r\n",strlen("\r\n"));
475                                    }
476                                    _lwrite(LogVar->FileHandle,"[",1);
477                                    // 変換した文字列の終端に \n が含まれているので取り除く。
478                                    _lwrite(LogVar->FileHandle, strtime, strlen(strtime) - 1);
479                                    _lwrite(LogVar->FileHandle,"] ",2);
480                            }
481    
482                          _lwrite(LogVar->FileHandle,(PCHAR)&b,1);                          _lwrite(LogVar->FileHandle,(PCHAR)&b,1);
483                          (LogVar->ByteCount)++;                          (LogVar->ByteCount)++;
484                  }                  }
# Line 530  void FileSendStart() Line 579  void FileSendStart()
579    if (strlen(&(SendVar->FullName[SendVar->DirLen]))==0)    if (strlen(&(SendVar->FullName[SendVar->DirLen]))==0)
580    {    {
581      Option = MAKELONG(ts.TransBin,0);      Option = MAKELONG(ts.TransBin,0);
582            SendVar->FullName[0] = 0;
583      if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option))      if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option))
584      {      {
585        FileTransEnd(OpSendFile);        FileTransEnd(OpSendFile);
# Line 1016  void BPStart(int mode) Line 1066  void BPStart(int mode)
1066      FileVar->OpId = OpBPSend;      FileVar->OpId = OpBPSend;
1067      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)      if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
1068      {      {
1069              FileVar->FullName[0] = 0;
1070        if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option))        if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option))
1071        {        {
1072          ProtoEnd();          ProtoEnd();
# Line 1076  void QVStart(int mode) Line 1127  void QVStart(int mode)
1127    
1128  /*  /*
1129   * $Log$   * $Log$
1130     * Revision 1.6  2006/08/28 12:27:16  maya
1131     * デフォルトのログファイル名を指定できるようにした。
1132     *   エディットコントロールを "Additional settings" ダイアログに追加した。
1133     *   teraterm.ini ファイルに LogDefaultName エントリを追加した。
1134     *   ファイル名に strftime のフォーマットを使えるようにした。
1135     *
1136     * Revision 1.5  2006/07/23 14:12:26  yutakakn
1137     * ログに含める日付フォーマットを世界標準書式に変更した。
1138     *
1139     * Revision 1.4  2006/07/22 16:15:54  maya
1140     * ログ記録時に時刻も書き込む機能を追加した。
1141     *
1142   * Revision 1.3  2005/05/07 09:49:24  yutakakn   * Revision 1.3  2005/05/07 09:49:24  yutakakn
1143   * teraterm.iniに LogTypePlainText を追加した。   * teraterm.iniに LogTypePlainText を追加した。
1144   *   *

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26