[Ttssh2-commit] [3848] filestat マクロコマンドの第2引数と第3引数を、文字列で返すようにした。

svnno****@sourc***** svnno****@sourc*****
2010年 4月 12日 (月) 00:41:07 JST


Revision: 3848
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3848
Author:   yutakapon
Date:     2010-04-12 00:41:06 +0900 (Mon, 12 Apr 2010)

Log Message:
-----------
filestat マクロコマンドの第2引数と第3引数を、文字列で返すようにした。

Modified Paths:
--------------
    trunk/doc/en/html/macro/command/filestat.html
    trunk/doc/ja/html/macro/command/filestat.html
    trunk/teraterm/ttpmacro/ttl.c


-------------- next part --------------
Modified: trunk/doc/en/html/macro/command/filestat.html
===================================================================
--- trunk/doc/en/html/macro/command/filestat.html	2010-04-07 12:12:09 UTC (rev 3847)
+++ trunk/doc/en/html/macro/command/filestat.html	2010-04-11 15:41:06 UTC (rev 3848)
@@ -40,7 +40,7 @@
 if result = -1 then
 	messagebox 'file open error' 'filestat'
 else
-	sprintf2 str 'File size=%d Time modified=%d Drive=%d' size time drive
+	sprintf2 str 'File size=%d Time modified=%s Drive=%s' size time drive
 	messagebox str 'filestat'
 endif
 </pre>

Modified: trunk/doc/ja/html/macro/command/filestat.html
===================================================================
--- trunk/doc/ja/html/macro/command/filestat.html	2010-04-07 12:12:09 UTC (rev 3847)
+++ trunk/doc/ja/html/macro/command/filestat.html	2010-04-11 15:41:06 UTC (rev 3848)
@@ -37,7 +37,7 @@
 if result = -1 then
 	messagebox 'file open error' 'filestat'
 else
-	sprintf2 str 'File size=%d Time modified=%d Drive=%d' size time drive
+	sprintf2 str 'File size=%d Time modified=%s Drive=%s' size time drive
 	messagebox str 'filestat'
 endif
 </pre>

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2010-04-07 12:12:09 UTC (rev 3847)
+++ trunk/teraterm/ttpmacro/ttl.c	2010-04-11 15:41:06 UTC (rev 3848)
@@ -1363,7 +1363,7 @@
 WORD TTLFileStat()
 {
 	WORD Err, SizeVarId, TimeVarId, DrvVarId;
-	TStrVal FName;
+	TStrVal FName, TimeStr, DrvStr;
 	struct _stat st;
 	int ret;
 	int result = -1;
@@ -1391,15 +1391,17 @@
 	}
 
 	if (CheckParameterGiven()) { 
-		GetIntVar(&TimeVarId,&Err);
+		GetStrVar(&TimeVarId,&Err);
 		if (Err!=0) return Err;
-		SetIntVal(TimeVarId, (int)st.st_mtime);
+		ctime_s(TimeStr, sizeof(TimeStr), &st.st_mtime);
+		SetStrVal(TimeVarId, TimeStr);
 	}
 
 	if (CheckParameterGiven()) { 
-		GetIntVar(&DrvVarId,&Err);
+		GetStrVar(&DrvVarId,&Err);
 		if (Err!=0) return Err;
-		SetIntVal(DrvVarId, st.st_dev);
+		_snprintf_s(DrvStr, sizeof(DrvStr), _TRUNCATE, "%c", st.st_dev + 'A');
+		SetStrVal(DrvVarId, DrvStr);
 	}
 
 	result = 0;



Ttssh2-commit メーリングリストの案内