Sergix / JTerm

A terminal written in Java for cross-platform compatibility and usage.
https://sergix.github.io/projects/jterm
GNU General Public License v3.0
52 stars 32 forks source link

Rename Files #70

Closed saringer closed 6 years ago

saringer commented 7 years ago

After taking a look at the roadmap I noticed that there are still a lot of issues open. As I'm very interested in this project I would like to contribute by adding an implementation for renaming files.

Sergix commented 7 years ago

Sounds good! Should be pretty simple.

Just open a PR when it's finished!

wuhugh commented 7 years ago

I noticed on the ROADMAP.md that there are a lot of overlap between directories and files. Should we only allow functions on directories to operate on directories and likewise for files?

For example, if I tried dir mv test it would fail if test was a file and not a directory.

Sergix commented 7 years ago

Yes, we should have seperate commands for directories and files regarding "repeating" commands such as mv and del, at least for now; if that's your question.

saringer commented 7 years ago

Yes shouldnt be to hard to implement. All I have to do is implement the appropriate method in the class "file.java". I will propose a solution in the upcoming week, as I had no time yet. For solving the issue I will use javas already existingrenameTo method https://docs.oracle.com/javase/7/docs/api/java/io/File.html

Sergix commented 7 years ago

Sounds good. And you can take as long as you need, really. Just make sure that the code in Files on your machine is up to date with the dev branch so there are no conflicts when trying to merge your code! 😀

wuhugh commented 7 years ago

Sorry, I don't think I phrased my question very well.

If we had a file example.txt and someone ran dir rm example.txt, should it remove the file or fail because it is not a directory?

Sergix commented 7 years ago

Well first off, just so you know, it's only rm now, the dir thing has been removed.

But to answer your question, it should remove the file. Now that we have changed the command format it would be better to include the code for file and directory removal in the same function.

Sergix commented 6 years ago

@saringer I regret to inform you that this feature has been added by @ojles. If you would like to help tackle something else, we have some other features that need to be completed. Please message me on Slack if you have any questions.