4 ms·
The Windows rename command doesn't support recursively processing subfolders, but it can be achieved using one line of powershell: Get-ChildItem . -Recurse -
by k1t 10y ago
The Windows rename command doesn't support recursively processing subfolders, but it can be achieved using one line of powershell:
Get-ChildItem . -Recurse -Include *.cha | Rename-Item -NewName { $_.name -Replace '\.cha','.txt' }
- flukus 10y agoFrom what I remember Include will only match items from the base directory and powershell gets stupidly complicated very quickly: http://flukus.github.io/2015/03/13/2015_03_13_Powershell-is-a-Joke/ http://flukus.github.io/2015/03/13/2015_03_13_Powershell-is-...
- oblio 10y agoThat compares Powershell to Nant. Nant tasks (inspired by Ant tasks) are more powerful than regular commands. Not even shell commands match those. He's comparing apples with an apple pie there.
- flukus 10y agoI started the article as a nant vs psake (PowerShell based build tool). Psake relies on PowerShell tools for things like copying files, which makes sense. I'm working on a similar one using make instead, which uses shell commands and it's a lot better than both.
- saghm 10y agoYou're probably right that Rust code isn't the most minimal way of doing this specific task, but I think the author's intended point was not "This specific task is best done by cross-compiling Rust for Windows" but rather "Rust is a viable alternative to using Python (or the like) for general-purpose cross-platform scripting; here is an example of something that's surprisingly easy to do with Rust". In this case, using a simpler example is just a way of making the demonstration of the concept easier, which I think is fairly effective.