Code Monkey home page Code Monkey logo

Comments (2)

fabiospampinato avatar fabiospampinato commented on August 25, 2024

I think this error is about renaming across different volumes, which in general is not an atomic operation so the OS says it can't do it, or at least that's how I understood it.

In the sanitized paths you provided I'm assuming the <username> and <user> placeholders are supposed to be the same string, right? If so then it seems weird that this error is thrown when renaming a file within the same folder, which I don't see how it could trigger that error. Maybe the user.json file is a symlink or something? I've no idea on how to reproduce this issue 🤔 And either way I'm not sure there are alternative strategies that could be used, we just need the rename to work for the write to be actually atomic.

Potentially what you could do is catching that error and falling back to regular writing, but obviously that's not great if you want your writes to not corrupt the file.

from atomically.

ci010 avatar ci010 commented on August 25, 2024

I think this error is about renaming across different volumes, which in general is not an atomic operation so the OS says it can't do it, or at least that's how I understood it.

In the sanitized paths you provided I'm assuming the <username> and <user> placeholders are supposed to be the same string, right? If so then it seems weird that this error is thrown when renaming a file within the same folder, which I don't see how it could trigger that error. Maybe the user.json file is a symlink or something? I've no idea on how to reproduce this issue 🤔 And either way I'm not sure there are alternative strategies that could be used, we just need the rename to work for the write to be actually atomic.

Potentially what you could do is catching that error and falling back to regular writing, but obviously that's not great if you want your writes to not corrupt the file.

Yes, the error should represent the cross volumes error, but I'm pretty sure both files are on the same folder. Currently I try to fallback to directly write the file back as workaround and it works okay.

from atomically.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.