News for hackers. Stuff that matters.
Re:Shell Script Best Practices, from a decade of scripting t... by ndsipa_pomu on Thursday October 27, 2022 @12:15PM (#33359804)
I tried to write a PowerShell script to recursively scan and find files/folders older than a certain date, but kept hitting problems with the length of the path/filenames. As a complete PowerShell noob, I'm sure I was trying to do it the wrong way, but after a few attempts, I gave up and install cygwin instead.
Re:Shell Script Best Practices, from a decade of scripting t... by Macha on Thursday October 27, 2022 @12:52PM (#33360452)
Your problem here is with win32 not powershell I suspect. Your script would probably have worked with powershell on Linux, but windows you need to use UNC paths to get a 2^16 - ~20 character path limit rather than the 256 character path limit of regular paths.

Or there's some registry hacks to remove the limit from regular paths.

Re:Shell Script Best Practices, from a decade of scripting t... by ndsipa_pomu on Thursday October 27, 2022 @01:25PM (#33360930)
You're probably right. It was a few years ago and after trying a couple of alternatives, just went with what I know.
Re:Shell Script Best Practices, from a decade of scripting t... by HyperSane on Thursday October 27, 2022 @02:14PM (#33361632)
You can enable long path support in Windows to have paths up to 32,767 characters long

https://learn.microsoft.com/en-us/windows/win32/fileio/maxim...

Re:Shell Script Best Practices, from a decade of scripting t... by ndsipa_pomu on Thursday October 27, 2022 @02:23PM (#33361778)
It was a few years back, so probably before Windows included that ability (Windows 10 onwards?)