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
request: File cp/mv/rm #1058
Comments
If somebody wants to tackle this, we'll be more than happy to merge pull requests for this. Ideally File/FileUtils should be in Crystal. |
Accidentally deleted my comment -- I would be happy to take this on, but on second thought this is low level C stuff which I really shouldn't be getting involved in. |
I would love trying this! I have pretty much memorized half the Posix filesystem functions from using them in C++. :O |
Same here @kirbyfan64 <3 |
Are |
They're nice in FileUtils since Rake includes it, so we can go shell-like in tasks. I'm not sure they're so interesting in Crystal. |
I agree with @kirbyfan64 here:
|
That depends: if we want include FileUtils
cp src, dst
File.rename dst, dst2
rm_rf dst2 That being said, these methods would be aliases, and maybe we don't want shell-induced naming, so we could prefer better method names in File and Dir, like |
Yes, I'm still unsure about what's the best thing to do here: have separate methods in File, Dir, etc. Or have them all in FileUtils with unix-like names. Or have both. Having both is really not a bad option, because if your code needs to do "bashy" stuff then it will look similar to bash, and if you need to rename a file here and there you can just use |
Sounds good to me. |
can we auto convert from this file : https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb |
@spalladino since #3420 is merged can we close this? |
Certainly! Thanks for spotting this @sdogruyol :-) |
@spalladino gracias 👍 |
Those are on FileUtils in Ruby
I don't have any particular opinion about where they should go (File, Dir, FileSystem, FileUtils, …)
The text was updated successfully, but these errors were encountered: