Feelings of White   i wish i had raped the monkey but what i did instead was good too
Me, looking like Hot Sex inc. with my cool shades, a beer and my bountiful chest hair displayed for all to see
  • all
  • curator's pick
  • funny
  • narcissism
  • technical
  • the arts
  • the void
  • violent aggression
  • writing

Good Goddamn, Powershell Sucks!

Apparently Blogger sucks too, 'cause I can't get this picture to display at full resolution. You'll have to click to read it:

In case you can't be bothered, powershell's remove-item crashes with
"The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."
Then cmd.exe's rd /s /q works just fine. cmd.exe.

Seriously. How. The. Fuck. Does this ship? How the fuck am I unable to delete files that the Operating System will allow me to create? When cmd.exe works? I'm sure there's a really interesting reason why this error happens. Some bizarre technical reason, or, more likely, some political tale about how people wanted to fix it, and couldn't. You know, the type of stuff that makes the daily wtf a popular site. But I don't care. Not right now.

Right now, I want Powershell to work at least as good as what it desires to replace.

I'm thinking there's a solution involving set-alias rm, but I haven't coded it yet... (probably won't either)

2007 Feb 06 3:46 pm; Filed under powershell and tagged bug, wtf.
« Nimoy, Takei Joke About White House Klingons on John Stewart « before «
» after » Good Goddamn, Blogger sucks too »
  • Ian

    Lol. Did you ever find out what is causing this? I have the same problem, some folders I try to remove return the error you mentioned, however the path is way less that 260 characters...

  • Legion

    Unfortunately not :(

    Although, to add to the issues (although it's not directly related), I've since discovered that filenames with square brackets "[", "]" can cause issues because the copy and move commands interpret filenames as regex expressions by default. I mention this only because it's the only other filename issue I've run into and can affect any path.

    Sorry I can't be of any more help and good luck with your problem (and if you find a solution I'd love to hear it, 'cause I'm still curious)

  • Stephen

    I have a pretty good idea of what the problem is and it's not a "bug" per se as much as a design consequence. PowerShell is tightly coupled to .NET. The underlying .NET classes in System.IO for dealing with the file system (File, Directory, FileInfo, DirectoryInfo) are unable to process extended length paths. This is why for any .NET application that uses the Windows filesystem in any advanced way will end up using the Win32 FindFirstFile(), FindNextFile() interface for traversing the file system. I would imagine that is what the Windows command prompt is using under the hood when you issue the 'rd' command.

blog comments powered by Disqus

Subscribe

Recent Awesomeness

  • Neurotic Dad
  • #8 VA vs. Brevity
  • Lost in the Epilogue
  • Jamie Oliver’s Food Revolution
  • I shoulda got a fake fingernail
  • How did this shit get started?
  • Feeding the dragon, or plant, or.. shit I’m out of time
  • Why are you eating so much soy and corn?
  • Cop Out
  • I’m A Stay At Home Dad!
  • Firefly & Serenity
  • The Kitchen of Zarro Boogs
  • America’s Got Talent FTW!
  • Steamed Salmon with Tomato Basil Couscous
  • Dream Stealers Like Me

Other Opinions

Sorry, I know colors suck, I will fix it sometime...

Find things tagged

4400 Battlestar Galactica Battlestar Galactica cliff comics curation depression erron family fiction food funny game janine job kelly kyle liam lost manifesto meta mlp music nathan passionate diatribes plug poem Really Dumb Story relationships review revisionism sam sermon software spirituality star trek Star Trek Deep Space Nine suicide tamdhu testpoint the process travels video vlad wtf

What was I doing in..

  • March 2011 (2)
  • August 2010 (23)
  • July 2010 (4)
  • June 2010 (1)
  • May 2010 (2)
  • April 2010 (2)
  • January 2010 (1)
  • December 2009 (4)
  • November 2009 (2)
  • October 2009 (1)
  • August 2009 (2)
  • July 2009 (2)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (3)
  • March 2009 (11)
  • February 2009 (6)
  • January 2009 (10)
  • December 2008 (3)
  • October 2008 (1)
  • August 2008 (2)
  • July 2008 (3)
  • June 2008 (1)
  • May 2008 (11)
  • April 2008 (7)
  • March 2008 (3)
  • February 2008 (1)
  • January 2008 (2)
  • December 2007 (1)
  • October 2007 (1)
  • September 2007 (3)
  • August 2007 (1)
  • June 2007 (3)
  • May 2007 (2)
  • March 2007 (5)
  • February 2007 (5)
  • January 2007 (13)
  • September 2006 (1)
  • June 2001 (3)
  • May 2001 (2)
  • April 2001 (2)
  • March 2001 (2)
  • February 2001 (1)
  • January 2001 (1)
  • November 2000 (5)
  • May 2000 (3)
  • April 2000 (5)
  • March 2000 (3)
  • February 2000 (3)
  • January 2000 (6)
  • December 1999 (17)

Copyright © 2009 Feelings of White | Powered by WordPress | Original site design by Stephen Reinhardt; tweaked by me