File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
docs/sources/v0.53.x/javascript-api/k6-experimental/fs Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ let file;
45
45
})();
46
46
47
47
export default async function () {
48
+ // Seek to the beginning of the file
49
+ await file .seek (0 , SeekMode .Start );
50
+
48
51
// About information about the file
49
52
const fileinfo = await file .stat ();
50
53
if (fileinfo .name != ' bonjour.txt' ) {
@@ -75,9 +78,6 @@ export default async function () {
75
78
if (totalBytesRead != fileinfo .size ) {
76
79
throw new Error (' Unexpected number of bytes read' );
77
80
}
78
-
79
- // Seek back to the beginning of the file
80
- await file .seek (0 , SeekMode .Start );
81
81
}
82
82
```
83
83
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ let file;
35
35
})();
36
36
37
37
export default async function () {
38
+ // Seek to the beginning of the file
39
+ await file .seek (0 , SeekMode .Start );
40
+
38
41
// About information about the file
39
42
const fileinfo = await file .stat ();
40
43
if (fileinfo .name != ' bonjour.txt' ) {
@@ -65,9 +68,6 @@ export default async function () {
65
68
if (totalBytesRead != fileinfo .size ) {
66
69
throw new Error (' Unexpected number of bytes read' );
67
70
}
68
-
69
- // Seek back to the beginning of the file
70
- await file .seek (0 , SeekMode .Start );
71
71
}
72
72
```
73
73
You can’t perform that action at this time.
0 commit comments