Code Monkey home page Code Monkey logo

Comments (7)

mananapr avatar mananapr commented on August 15, 2024

Hi, I wasn't able to reproduce this issue.

Firstly, cfiles bookmarks directories and not files and forward slash is not a valid character for directory names (atleast in ext4).

Secondly, I tried making a directory named test\na:Public and bookmarked it to z. Then I pressed ' + z to go to test\na:Public and it worked.

You can see this terminal cast for example. Thanks!

from cfiles.

cym13 avatar cym13 commented on August 15, 2024

I see the issue, it's not a forward slash, it's a newline "\n".

You may create it using the following shell command:

mkdir 'test'$'\n''a:Public'

Then go in this directory and bookmark it. I definitely could reproduce the issue in the latest version.

from cfiles.

mananapr avatar mananapr commented on August 15, 2024

You are right, the issue exists. How can I encode \n? To be clear I mean what would I encode it too?

from cfiles.

cym13 avatar cym13 commented on August 15, 2024

I'd replace it with something that isn't allowed in a filename... Since you only ever take paths from the system maybe a double slash?

z:/tmp/test//a:Public

The worst that can happen is if you take a path from the user and she provides it with a double slash (which is valid but is reduced by the system to only one slash) but I can't see that happening in the case of bookmarks.

Either that or use an encoding convention, either limited such as saying "TheΒ % sign is followed by two characters giving the ascii code of the character, \n becomes %0A, % becomes %25" (url encoding), or go full encoding by storing base64 for example.

EDIT: I'm really not fan of the double-slash solution. I had a look at my bookmarks and saw a path starting by //, so I must have entered it somehow outside of related tests. My assumption that it can't happen seems flawed, I'd go with something like % encoding instead.

from cfiles.

mananapr avatar mananapr commented on August 15, 2024

There was a bug due to which paths used to start with // instead of / after visiting the root directory once. I fixed this in 666a935. So is the double slash solution good enough now?

from cfiles.

cym13 avatar cym13 commented on August 15, 2024

I think so, and if it ever comes back to be an issue it'll still be time to change.

from cfiles.

mananapr avatar mananapr commented on August 15, 2024

I went with the double slash solution. rev 72771db has the relevant changes. Let me know if it has any errors.
Also sorry for the late reply, I have been getting a lot work from my uni.

from cfiles.

Related Issues (20)

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.