Skip to content

Commit

Permalink
fix not being able to read files more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammerIn-wonderland committed Oct 5, 2024
1 parent 1ff21fc commit d6b061d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/api/LocalFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class LocalFS extends AFSProvider<LocalFSStats> {
path = this.relativizePath(path);
const stats = this.stats.get(path);

if (stats && stats.isSymbolicLink()) {
if (stats && stats.isSymbolicLink) {
const target = stats.target;
if (this.stats.has(target)) {
path = target; // Follow symlink to the target path
Expand Down Expand Up @@ -303,7 +303,7 @@ class LocalFS extends AFSProvider<LocalFSStats> {
path = this.relativizePath(path);
const stats = this.stats.get(path);

if (stats && stats.isSymbolicLink()) {
if (stats && stats.isSymbolicLink) {
const target = stats.target;
if (this.stats.has(target)) {
path = target; // Follow symlink to the target path
Expand Down Expand Up @@ -624,7 +624,7 @@ class LocalFS extends AFSProvider<LocalFSStats> {
path = this.relativizePath(path);
const stats = this.stats.get(path);

if (stats && stats.isSymbolicLink()) {
if (stats && stats.isSymbolicLink) {
const target = stats.target;
if (this.stats.has(target)) {
path = target; // Follow symlink to the target path
Expand Down Expand Up @@ -667,7 +667,7 @@ class LocalFS extends AFSProvider<LocalFSStats> {
}

// Ensure the path is a symlink
if (!stats.isSymbolicLink()) {
if (!stats.isSymbolicLink) {
return reject({
name: "EINVAL",
code: "EINVAL",
Expand Down Expand Up @@ -712,9 +712,9 @@ class LocalFS extends AFSProvider<LocalFSStats> {
mtimeMs: Date.now(),
ctimeMs: Date.now(),
birthtimeMs: Date.now(),
isDirectory: () => false,
isFile: () => false,
isSymbolicLink: () => true, // Add a flag to indicate it's a symlink
isDirectory: false,
isFile: false,
isSymbolicLink: true, // Add a flag to indicate it's a symlink
target, // Store the target path
});

Expand Down

0 comments on commit d6b061d

Please sign in to comment.