Skip to content

Commit

Permalink
Added fixes into code example in fs/_index.md and fs/file/_index.md (#…
Browse files Browse the repository at this point in the history
…1713)

* Added fix into code example in _index.md

* added fix of code example in file/_index.md
  • Loading branch information
itev4n7 authored Aug 30, 2024
1 parent e420733 commit 6061a91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ let file;
})();

export default async function () {
// Seek to the beginning of the file
await file.seek(0, SeekMode.Start);

// About information about the file
const fileinfo = await file.stat();
if (fileinfo.name != 'bonjour.txt') {
Expand Down Expand Up @@ -75,9 +78,6 @@ export default async function () {
if (totalBytesRead != fileinfo.size) {
throw new Error('Unexpected number of bytes read');
}

// Seek back to the beginning of the file
await file.seek(0, SeekMode.Start);
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ let file;
})();

export default async function () {
// Seek to the beginning of the file
await file.seek(0, SeekMode.Start);

// About information about the file
const fileinfo = await file.stat();
if (fileinfo.name != 'bonjour.txt') {
Expand Down Expand Up @@ -65,9 +68,6 @@ export default async function () {
if (totalBytesRead != fileinfo.size) {
throw new Error('Unexpected number of bytes read');
}

// Seek back to the beginning of the file
await file.seek(0, SeekMode.Start);
}
```

Expand Down

0 comments on commit 6061a91

Please sign in to comment.