-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestPy.js
More file actions
69 lines (62 loc) · 1.59 KB
/
testPy.js
File metadata and controls
69 lines (62 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
var fs=require('fs')
// function sleep(time=0){
// return new Promise((resolve,reject)=>{
// setTimeout(()=>{
// resolve();
// },time);
// })
// }
path='/opt/WriteProgram2/'
var i=1
var j=0
var staticline='null'
while(i<30){
// var x=1
// function r(x){
//
// fs.readFile(path+'test.txt',function(err,data){
// var dystr=data.toString();
// //console.log(data);
// j=staticline.localeCompare(dystr);
// if (j==0){
// console.log(dystr);
// staticline=dystr;
// fs.appendFileSync('./test3.txt',dystr)
// }
// })}
// while (i<20){r(1);i=i+1}
//console.log(dystr);
// console.log(staticline);
//var dystr=data.toString();
var dystr=fs.readFileSync(path+'test.txt','UTF-8');
//j=dystr.localeCompare(staticline);
//console.log(dystr);
// // console.log(j);
// // if (j==0){
// // j=j+100
// // }
// //console.log(typeof(j),j)
if (dystr===staticline){continue}
else{
console.log(dystr)
console.log(staticline)
staticline=dystr.toString()
//fs.appendFileSync('./test3.txt',dystr)
}
i=i+1;
// // var j=0
// fs.readFile(path+'test.txt','UTF-8',function(err,data){
// if(err){
// console.log(err);
// }else{
// var j=staticline.localeCompare(data);
// if (j==0){
// j=j+100
// }
// if (j<10){
// console.log(data);
// staticline=data;
// }
// }
// })
}