Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Having a dot inside the directory path breaks copy/paste of file #464

Closed

Description

@FlorianLudwig

Having a dot inside the directory path breaks copy/paste of files. It seems atom tries to append a number before the first dot it finds. This should not be done with the full path but just the file name and also the last and not first dot should be used.

Error: EACCES: permission denied, mkdir '/home/f0.ludwig'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:791:18)
    at sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:55:12)
    at sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:61:24)
    at sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:61:24)
    at sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:61:24)
    at sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:61:24)
    at sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:61:24)
    at sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:61:24)
    at Function.sync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/node_modules/mkdirp/index.js:61:24)
    at Object.fsPlus.writeFileSync (/usr/share/atom/resources/app.asar/node_modules/fs-plus/lib/fs-plus.js:278:14)
    at TreeView.module.exports.TreeView.pasteEntries (/usr/share/atom/resources/app.asar/node_modules/tree-view/lib/tree-view.js:965:32)
    at space-pen-div.atom.commands.add.tree-view:paste (/usr/share/atom/resources/app.asar/node_modules/tree-view/lib/tree-view.js:277:26)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:238:29)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app.asar/src/command-registry.js:153:19)

Activity

  1. lee-dohm commented on Jun 4, 2015

    @lee-dohm
    Contributor

    Can you give some steps to reproduce this issue? I'm not clear on how it is you came to this error.

  2. FlorianLudwig commented on Jun 4, 2015

    @FlorianLudwig
    Author

    Just copy/paste a file inside a folder that contains a "."

    In my case it is the folder "/home/f.ludwig/some/place/my_file.txt". tree-view tries to create a "/home/f0.ludwig/some/place/my_file.txt" but really should "/home/f.ludwig/some/place/my_file0.txt"

    Reproduce the problem with

    mkdir foo.bar
    cd foo.bar
    touch my_file.txt
    atom .
    

    in atom copy & paste my_file.txt and you get a new folder called "foo0.bar"

    To reproduce the traceback:

    mkdir test
    cd test
    mkdir foo.bar
    chmod -w . 
    cd foo.bar
    touch my_file.txt
    atom .
    

    in atom copy & paste my_file.txt and you get the traceback

  3. thomasjo commented on Jun 4, 2015

    @thomasjo
    Contributor

    I believe this is caused by the duplicate filename algorithm. Haven't had time to check, but it's likely doing something a little bit too naive with regards to path splitting.

  4. izuzak commented on Jun 9, 2015

    @izuzak
    Contributor

    Yeah, looks like a problem here -- I was able to reproduce this. Thanks for the detailed steps, @FlorianLudwig. 🙇

  5. software-opal commented on Feb 23, 2016

    @software-opal

    I just experienced a related problem with a file named mychange.up.sql, copy and pasting that file creates a new file named mychange0.up(without the .sql extension). I haven't checked if #649 fixes this. I will check later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions