diff --git a/zh-cn/application-dev/reference/apis/js-apis-fileio.md b/zh-cn/application-dev/reference/apis/js-apis-fileio.md index 25d4499022f4a77670b49ac4f79ddae7d27316b1..9ba948beaccf86693e6d13fe257ab5554212659b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-fileio.md +++ b/zh-cn/application-dev/reference/apis/js-apis-fileio.md @@ -68,7 +68,7 @@ stat(path: string): Promise<Stat> ```js let filePath = pathDir + "test.txt"; fileio.stat(filePath).then(function(stat){ - console.info("getFileInfo succeed:"+ JSON.stringify(stat)); + console.info("getFileInfo succeed, the size of file is " + stat.size); }).catch(function(err){ console.info("getFileInfo failed with error:"+ err); }); @@ -153,7 +153,7 @@ opendir(path: string): Promise<Dir> ```js let dirPath = pathDir + "/testDir"; fileio.opendir(dirPath).then(function(dir){ - console.info("opendir succeed:"+ JSON.stringify(dir)); + console.info("opendir succeed"); }).catch(function(err){ console.info("opendir failed with error:"+ err); }); @@ -1178,7 +1178,7 @@ fstat(fd: number): Promise<Stat> let filePath = pathDir + "/test.txt"; let fd = fileio.openSync(filePath); fileio.fstat(fd).then(function(stat){ - console.info("fstat succeed:"+ JSON.stringify(stat)); + console.info("fstat succeed, the size of file is "+ stat.size); }).catch(function(err){ console.info("fstat failed with error:"+ err); }); @@ -1525,7 +1525,7 @@ lstat(path: string): Promise<Stat> ```js let filePath = pathDir + "/test.txt"; fileio.lstat(filePath).then(function(stat){ - console.info("get link status succeed:"+ JSON.stringify(stat)); + console.info("get link status succeed, " + the size of file is + stat.size); }).catch(function(err){ console.info("get link status failed with error:"+ err); }); @@ -3166,7 +3166,7 @@ read(): Promise<Dirent> ```js dir.read().then(function (dirent){ - console.log("read succeed:"+JSON.stringify(dirent)); + console.log("read succeed, the name of dirent is " + dirent.name); }).catch(function(err){ console.info("read failed with error:"+ err); }); @@ -3193,7 +3193,7 @@ read(callback: AsyncCallback<Dirent>): void dir.read(function (err, dirent) { if (dirent) { // do something - console.log("read succeed:"+JSON.stringify(dirent)); + console.log("read succeed, the name of file is " + dirent.name); } }); ```