Skip to content

Commit

Permalink
1. 修复 从 淘宝 获取位置信息输出临时文件错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
shudingbo committed Sep 12, 2017
1 parent 950a72b commit fa5e1c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
11 changes: 2 additions & 9 deletions js/getloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ getLoc.getRecsLocation = function( cfg )
if( progress.length === 0 ){
let fileName = pathC.basename( cfg.savePath,'.bin' );
fileName += "_" + cfg.off[0] + ".bin";
fileName = pathC.join( pathC.dirname( cfg.savePath ), fileName );
let fd = fs.openSync( fileName, 'w' );
fs.close( fd );
}
Expand Down Expand Up @@ -113,15 +114,6 @@ function get_ip_location( ip ,cb )
req.end();
}

function writeRecByTemplate( rec,cfg ){
let fileName = pathC.basename( cfg.savePath,'.bin' );
fileName += "_" + cfg.off[0] + ".bin";
let fd = fs.openSync( fileName , 'a+' );
let loc = rec;
let msg = eval( cfg.template ) + "\n";
fs.writeSync( fd, msg);
fs.closeSync( fd);
}

function writeRecord( rec, loc,cfg )
{
Expand All @@ -143,6 +135,7 @@ function writeRecord( rec, loc,cfg )

let fileName = pathC.basename( cfg.savePath,'.bin' );
fileName += "_" + cfg.off[0] + ".bin";
fileName = pathC.join( pathC.dirname( cfg.savePath ), fileName );

let fd = fs.openSync( fileName , 'a+' );
let sIP = ipC.toLong( rec[0] );
Expand Down
1 change: 1 addition & 0 deletions out/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����ļ���

0 comments on commit fa5e1c4

Please sign in to comment.