Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erratic behavior of fc.move #244

Open
jeff-zucker opened this issue Mar 12, 2024 · 0 comments
Open

Erratic behavior of fc.move #244

jeff-zucker opened this issue Mar 12, 2024 · 0 comments

Comments

@jeff-zucker
Copy link
Owner

jeff-zucker commented Mar 12, 2024

The move function creates extraneous .acl,.meta, and .meta.acl files.

This simple, test illustrates the problem :

onst $rdf = global.$rdf = require('rdflib');
const {SolidFileClient} = require('../');
const {SolidNodeClient} = require('solid-node-client');
const {cwd} = require('process');
const fs = require('fs');

const fc = new SolidFileClient( new SolidNodeClient({parser:$rdf}) );

let base = 'file://' + cwd();
let fbase = cwd();
let res;

async function test(){

  await cleanTestFolders();

  fs.readdir(fbase+"/test/", async (err, files) => {
    console.log("test/ contains ",files||[]);
    res = await fc.createFile(base+"/test/foo.txt","bar","text/plain");
    console.log(res.status,"createFile");
    res = await fc.move(base+"/test/foo.txt",base+"/test/bar.txt");
    console.log(res.status,"move");
    fs.readdir(fbase+"/test/", (err, files) => {
      console.log("test/ contains ",files);
    });
  });

}
test();

async function cleanTestFolders(){
  await fc.delete(base+"/test/foo.txt");
  await fc.delete(base+"/test/bar.txt");
  await fc.delete(base+"/test/");
}
```

These are the results I get.
```
test/ contains  []
201 createFile
201 move
test/ contains  [ 'bar.txt', 'bar.txt.acl', 'bar.txt.meta', 'bar.txt.meta.acl' ]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant