LWN.net Logo

Quotes of the week

Why can DOS delete an infinite number of files and rm can't? Because rm was written using the "vi" editor and it causes brain damage and that's why after 20 years rm hasn't caught up with del.
-- Marc Perkel has solutions for all our problems

Asserting that critics should patch the holes in your handwaving is unlikely to impress anybody; arrogance is not in short supply around here and yours is not even original.
-- Al Viro responds (thanks to Dag Bakke).
(Log in to post comments)

Quotes of the week

Posted Aug 23, 2007 2:53 UTC (Thu) by dowdle (subscriber, #659) [Link]

How does Marc know that rm was written by someone using the vi editor?

Why is a failure of rm a Linux kernel problem. Sounds to me that it is an application problem. There are alternatives to rm.

Quotes of the week

Posted Aug 23, 2007 3:45 UTC (Thu) by stephenjudd (subscriber, #3227) [Link]

It is a kernel problem. Specifically, the execve() call. The buffer that passes the environment (including args) from one process to another is fixed size and can be too small.

But another way of looking at it is that in the DOS/Windows world, it's the responsibility of an app to expand a glob because DOS was too puny to manage that, whereas in Unix land we leave it to the shell.

vi doesn't really come into it though :)

The kernel doesn't enter into it

Posted Aug 23, 2007 4:09 UTC (Thu) by felixfix (subscriber, #242) [Link]

The kernel and exec have nothing to do with it. After all, if expansion were handled by applications instead of the shell, the current exec implementations could not tell the difference. I suspect it all goes back to the original implementors, who decided they would rather have the shell expand args than applications. One place for that code, in the shell, was more attractive than duplicating it in each application, even if it were done with #include or libraries. Did the original UNIX have shared libraries? That may have been a factor too, since without shared libraries, all that code would also have been duplicated in the binaries, and it would make more sense to have it in the shell. Think of the shell as the application's boot code. The more initialization code can be discarded to make room for runtime code, the happier runtime is.

Yes, it does.

Posted Aug 23, 2007 8:15 UTC (Thu) by AnswerGuy (guest, #1256) [Link]

The error is "Argument list to long" which is the prerror() (library function) string associated with the -E2BIG errno --- which is returned by the kernel when the argument and environment cannot be copied into the buffer used by the execve() system call. (Linux currently uses a 128K statically sized buffer for execve()).

All of this can be easily demonstrated using commands like:

/bin/echo $(python -c 'print "foo " * 10 ** 5')

... (try to use an external echo command to on an argument list consisting of a 100,000 instances of the word "foo ")

... or with something like:

/bin/echo /* /*/* /*/*/* /*/*/*/*

... (which will try to echo the names of all the files and directory down to about four-levels deep on your system's file-tree)

... and that this is coupled to the environment is demonstrated by:

export FOO="$(python -c 'print "a" * 10 ** 8')

... followed by any normal external command (such as ''ls'').

In both cases you will get "Argument list to long" and if you were to strace these you'd find that the -E2BIG error was being returned by the execve() system call. (The fact that the environment is copied in with the argument list is a little surprising to some --- but not to those of us who have seen the old, pre-K&R prototype for int main (int argc, char **argv, char **env) --- a pointer to the environment is being passed along with the argument count and the argument vector. It's still being passed to modern C programs under Unix/Linux --- it's just that direct use of that third argument/pointer is deprecated in favor of using the environ.h defined functions in libc ... which are intended to prevent corruption of your environment).

The fact that rm cannot normally remove some arbitrarily long list of files is simply a consequence of how UNIX shells expand glob patterns (on the one hand) and how most UNIX kernels have traditionally implemented execve() --- and this limitation does currently apply to Linux.

The fact that MS-DOS' "DEL" command can, theoretically, handle an unlimited number of files is a consequence their command line handling APIs. Specifically MS-DOS "wildcard patterns" (which are not precisely the same as UNIX glob patterns --- in ways that normal people need not concern themselves). MS-DOS programs make a library/API call to the "find first" function (don't remember the exact spelling/punctuation and character case for its name and don't feel like looking it up). Thereafter such programs go into a loop calling the "find next" until that returns an error or sentinel indicating that there are no more "next" matches.

Naturally one *could* implement a similar API under UNIX/Linux. One *could* have users call a command (perhaps naming it 'DEL' which if one passed it (quoted) wildcard patterns (quoted to avoid having the shell mistake them for glob patterns). Such a library or program *could* then use opendir() and implement a "findfirst()" with "findnext()" semantics. One could even write a shell named COMMAND.COM and have it implement these semantics for all it's built-in commands and assume that such semantics would be followed by any external commands.

None of this points to any fundamental deficiency in UNIX nor Linux (nor even in MS-DOS, for that matter). They are simply differences.

The quote, while amusing as a joke doesn't withstand a moment's worth of competent technical scrutiny. Any sysadmin worth his salt knows how to use find ... | xargs rm or the less efficient find ... -exec 'rm' '{}' \; or the more exotic perl -e "unlink <$GLOB>;"

(If a prospective intermediate to advanced Linux/UNIX sysadmin, can't tell me at least one way to handle "argument list too long" in an interview, then he or she probably won't get my recommendation for the job. An *advanced* one should be able to tell me *why* it's that way as well as some way to work around it).

JimD

Yes, it does.

Posted Aug 23, 2007 8:46 UTC (Thu) by bronson (subscriber, #4806) [Link]

Or, you can just make the problem *poof* go away. :)

http://article.gmane.org/gmane.linux.kernel/571954

That would be so cool to never see "Argument list too long" ever again.


Yes, it does.

Posted Aug 23, 2007 12:03 UTC (Thu) by nix (subscriber, #2304) [Link]

Such a globbing library has existed for many years: in truly ancient Unix every program actually had to do globbing on its own by linking to a globbing library.

Some programs (e.g. find(1) and directory viewing programs) still have to glob themselves.

(Oh, and the differences between DOS wildcards and the wild variety of Unix globs are truly significant to anyone who's used wildcards at all: just the name * matches different files in DOS and Unix as long as any of the files in this directory have an extension.)

You typed a lot for no purpose

Posted Aug 23, 2007 13:52 UTC (Thu) by felixfix (subscriber, #242) [Link]

What a lot of verbiage for no gain!

What I said was that switching to DOS style would not involve the kernel, that the kernel would never know the difference. You have done nothing but illustrate why the current system gets an error, which everybody already knows and suffers with.

I also speculated as to why UNIX was designed this way, and you didn't answer any of that.

Re: You typed a lot for no purpose

Posted Aug 23, 2007 18:50 UTC (Thu) by AnswerGuy (guest, #1256) [Link]

What you *said* was that the kernel had nothing to do with "it."

The verbiage was to clarify that the kernel does, indeed, have alot to do with "it" (the fact that the existing implementations of the common UNIX 'rm' command can only handle a limited number of arguments).

Your verbiage, or lack thereof, did not make it clear that you understood execve() and that the "it" to which you were referring was some hypothetical implementation of 'rm' based on MS-DOS like semantics.

As for the purposes served by my efforts --- perhaps they were of no value to you. However, my message should clarify matters for the many other people who follow these threads. Some of these will learn from it; and some who had an intuitive grasp of it might find that my explanation helps them when they go to teach someone else --- particularly given the couple of simple shell command examples that help illustrate the point. In general my participation in online fora such as this is for the benefit of many, not merely an opportunity to show off my profound knowlege of UNIX/Linux minutiae.

Yes, it does.

Posted Aug 28, 2007 16:19 UTC (Tue) by skx (subscriber, #14652) [Link]

This might be old-hat to some users, but I recently discovered that "find" upon my Debian GNU/Linux machine has a useful flag:

$ find . -name "*.deb" -delete

- No need to call 'xargs', or use -exec at all!

Globbing style

Posted Aug 23, 2007 5:37 UTC (Thu) by eru (subscriber, #2753) [Link]

it's the responsibility of an app to expand a glob because DOS was too puny to manage that,

It is more a matter of style. The DOS behaviour comes from CP/M, which in turn was inspired by various old minicomputer operating systems. Ever used VMS? It is another system (and certainly not puny!) where applications are expected to handle the globbing.

There are actually also advantages to this. On MS-DOS and VMS you can implement a command like "rename *.cpp *.cc" to rename systematically. I actually needed to use this particular command a few days ago, because of the quirks of the VMS port of GCC. (By the way, what is the shortest command to achieve the same thing on Linux with standard tools? In situations like this I have resorted to a for-loop that calls a small self-written program (for $name in *.oldsuffix; do mv $name `suffrep $name .newsuffix`; done), but is there more standard way? Or should I try to get suffrep into the POSIX standard :-)

As to the other speculation about lack of shared libraries being the cause of the unix style: operating systems with globbing handled by apps typically have a pair of system calls named something like find_first and find_next to iterate through a directory with a wildcard filter.

Globbing style

Posted Aug 23, 2007 6:31 UTC (Thu) by pebolle (guest, #35204) [Link]

"By the way, what is the shortest command to achieve the same thing on Linux with standard tools?" See man 1 rename:

rename .cpp .cc *.cpp

Globbing style

Posted Aug 23, 2007 7:10 UTC (Thu) by BlueLightning (subscriber, #38978) [Link]

Wow, you learn something new every day. Thanks!

Globbing style

Posted Aug 23, 2007 8:21 UTC (Thu) by MathFox (guest, #6104) [Link]

According to the manpage on Ubuntu it is

rename s/.cpp/.cc/ *.cpp

Gentoo has the "rename .cpp .cc *.cpp" variant.

rename

Posted Aug 23, 2007 8:45 UTC (Thu) by eru (subscriber, #2753) [Link]

Thanks to all, I had not realized such a command has appeared (not in the set of Unix commands I learned to my spine back in the 1980's...). Seems my Fedora 6 also has this "rename .cpp .cc *.cpp" -style command. Too bad there is not yet agreement on the syntax, apparently, and you can't rely on this outside Linux.

rename

Posted Aug 30, 2007 1:42 UTC (Thu) by set (guest, #4788) [Link]

One comes from the util-linux package[!?], and the other is
a separate project:

http://rename.berlios.de/

There appear to be 3 or 4 other packages for renaming files,
including krename...

Maybe someday one will make it to the GNU core file utils...

Globbing style

Posted Aug 23, 2007 9:46 UTC (Thu) by wookey (subscriber, #5501) [Link]

Not a 'standard tool' answer, but as I can never remember any of the standard tools ways of doing it, I usually use mc (midnight commander) to do fancy renames. It is really very smart about this and you can do things like renaming *2.6.21* to ** to remove all the '2.6.21' from an arbitrary list of files. I find this very handy indeed (like the whole of the rest of mc, which gives you nice things like vfs over ssh or ftp and into tarballs and debs). It remains my file-manager of choice despite being a fancy crib of a 1980s DOS package.

Globbing style

Posted Aug 26, 2007 5:33 UTC (Sun) by nlucas (subscriber, #33793) [Link]

What I use "rename" most is exactly the example they have on the manpage: how to lowercase a set of files (mostly useful when working with samba shares, although one can setup samba to do it "auto magically"):

rename ’y/A-Z/a-z/’ *

This is the kind of thing you can't do on DOS (but you don't need it, though).

On the other hand, I had already some "fights" over the fact that having the application do the globing would be best, although I can also understand if that happen then the standard could disappear because of programmer laziness.

A similar thing is the syntax for application parameters. They are handled by the application and there are some "standard" ways of dealing with them, but even so DOS applications decided to go their way (with the "/option" mode) and there isn't consistency even between *nix applications (some use "-option" others "--option", the GNU projects have the mixed mode of short and long options, etc).

Globbing style

Posted Aug 23, 2007 6:34 UTC (Thu) by jimparis (subscriber, #38647) [Link]

If you use bash, it has various string manipulation functions built in.

$ for i in *.cpp; do mv $i ${i%cpp}.cc ; done

If you don't use bash, you could use something like sed:

$ for i in *.cpp; do mv $i $(echo $i | sed s/.cpp$/.cc/) ; done

Yeah, for some things, the DOS way of handling it is a lot easier. But Unix is also a lot more powerful -- you could put literally anything inside that sed command. That's what I like about the Unix command line -- it's not pretty, but once you start learning the patterns, my interactions all feel like a straightforward "let me clearly specify what I want to do" regardless of how complicated they are.

Globbing style

Posted Aug 23, 2007 6:40 UTC (Thu) by asamardzic (guest, #27161) [Link]

In situations like this I have resorted to a for-loop that calls a small self-written program (for $name in *.oldsuffix; do mv $name `suffrep $name .newsuffix`; done), but is there more standard way?

for name in *.oldsuffix; do mv $name ${name%%.oldsuffix}.newsuffix; done

Patterned renaming or copying, using UNIX/Linux shell

Posted Aug 23, 2007 8:41 UTC (Thu) by AnswerGuy (guest, #1256) [Link]

This is a question I've dealt with many times on mailing lists, news groups,
and in classes that I teach on the topic of systems administration.

The simplest and most practical alternative is to rethink the problem and use a subdirectory. For example instead of COPY *.TXT *.BAK use ''mkdir ./bak; cp *.txt ./bak'' Often this will actually work better.

However, for cases where you really have a set of files which have to be renamed or copied based on some pattern replacement, you'd generally think in terms of "sed" (you are substituting some substring in the existing name with some text, which is precisely the most common use of sed).

So you use commands like:

for i in *.cxx; do mv $i $( echo $i | sed -e 's/\.cxx$/.cpp/'); done

However, that looks ugly and verbose. You can often use simpler constructs like:

for i in *.cxx; do mv $i $(basename $i .cxx).cpp; done

(Using GNU basename's ability to strip off filename extensions in addition to any leading pathname components).

You can also use Bash "parameter substitution" operators like ${x##...} or ${x%%...} or the relatively new ${x//...} glob substitution stuff.

For example:

for i in *.cxx; do mv $i ${i#.cxx}.cpp; done

(You can read more about these ${variable*} parameter substitution expressions in the GNU bash man pages --- and Korn shell and even some
simpler Bourne shells like ash, dash etc support some of them as well).

Of course all of these look more complicated than simple REN *.CXX *.CPP,
but that's, in part, because MS-DOS has such a constrained notion of what a filename looks like. The interpretation of *.CXX *.CPP to mean replace the characters CXX with CPP is rather idiomatic and makes no sense in a system which doesn't constrain filenames to a single dot followed by up to three characters for an extension.

The fact that UNIX supports free form filenames necessitates greater precision when trying to perform these sorts of patterned name replacements.

JimD

Patterned renaming or copying, using UNIX/Linux shell

Posted Aug 23, 2007 9:12 UTC (Thu) by eru (subscriber, #2753) [Link]

Thanks for the nice collection of for-loop solutions, jimparis, asamardzic, and AnswerGuy. I learned a lot, but solutions miss the point slightly in that they are rather complex and long to type for solving a simple, common problem. Of course I realize the power of the unix command line is in how it allows building new solutions from basic blocks, but common tasks still benefit from "prepackaged" commands (like "head" and "tail" can be simulated by "sed" or "awk", but these special cases are still worh keeping).

As noted in prior thread, other people have tried to tackle this by introducing a "rename" command, unfortunately not yet standard (apparenly not even within Linux world).

Here I have to disagree a bit:

interpretation of *.CXX *.CPP to mean replace the characters CXX with CPP is rather idiomatic and makes no sense in a system which doesn't constrain filenames to a single dot followed by up to three characters for an extension.

I think it would make perfect sense. You could read it as "replace the * in the second pattern with the sub-string matched by the * in the first pattern", without requiring dots to appear anywhere. The MS-DOS and VMS versions are not actually that sophisticated, but a hypothetical "rename for unix" could well be.

Patterned renaming or copying, using UNIX/Linux shell

Posted Aug 23, 2007 9:28 UTC (Thu) by asamardzic (guest, #27161) [Link]

Write a shell function rename(), accepting 2 patterns as arguments, and put any of solutions presented (btw, as jimparis initially wrote, indeed it's much better to use single % instead of %% as I used, because single % means shortest match, and %% means longest match; although take care that in jimparis command line there is % missing after %) into its body, put this function into your ~/.bashrc and that's it.

It's hard for any system to come up with every solution for every user; for example, I can't remember that I ever had a need for alike rename (while I must confess that I'm often asked by previous DOS/Windows users how to accomplish it). But the good thing with Unix is that it empowers its users with tools needed to easily build alike solutions..

Patterned renaming or copying, using UNIX/Linux shell

Posted Aug 23, 2007 9:34 UTC (Thu) by asamardzic (guest, #27161) [Link]

...take care that in jimparis command line there is % missing after %...

Mhm, that should read: ...take care that in jimparis command line there is . missing after %...

Patterned renaming or copying, using UNIX/Linux shell

Posted Aug 23, 2007 22:48 UTC (Thu) by amikins (guest, #451) [Link]

That's a reminder I both have to give some of my associates, and sometimes need myself..

Define your problem space clearly. What are you REALLY trying to accomplish? Does it really have to use the mechanism you're trying to force into the scenario? Can you accomplish the end goal using an entirely different chain of steps?

So if your goal is "We want to put aside these files, because we're going to have new files with the same name but don't want to lose the old ones", you're right, a directory could easily be the answer. As could be a tarball solution, for some cases.

Globbing style

Posted Aug 23, 2007 11:50 UTC (Thu) by cortana (subscriber, #24596) [Link]

Others have already pointed out rename(1) (which is standard if you consider perl standard). I thought I'd point out a way to replace your suffrep command with a shell expansion:

$ foo=bar.baz
$ echo ${foo%.baz}.qux
bar.qux

This may be a bashism of course. :)

Globbing style

Posted Aug 23, 2007 16:15 UTC (Thu) by branden (subscriber, #7029) [Link]

It's not a Bashism. It's standard POSIX parameter expansion.

Globbing style

Posted Aug 23, 2007 21:08 UTC (Thu) by oak (guest, #2786) [Link]

And works even in the Busybox shell...

Globbing style

Posted Aug 23, 2007 15:33 UTC (Thu) by chrish (subscriber, #351) [Link]

There's also the mmv series of tools:

mmv '*.cpp' '#1.cc'

(There's also mcp, mln, and even "mad", which appends to the target.)

Quotes of the week

Posted Aug 23, 2007 10:13 UTC (Thu) by ekj (guest, #1524) [Link]

Dunno. But rm never enters into it at all. The problem manifests itself before rm even starts.

The *shell* expands the * before executing rm, so typing rm * is really the shell expands that and gets "rm file1 file2 file3 file4...." which it then tries to execute. Which fails, because linux has a max-limitation on the length of the argument-list.

So, this is definitely a weakness, but it's in linux and not in "rm", you get precisely the same error if you type "any-command *" in a directory with enough files that the argument-list gets too long.

Having rm do the expand the list would "solve" the problem but introduce two new worse problems:

1) You'd have to implement the globbing in *ALL* programs that accept any kind of parameters that can be globbed. This means teaching thousands of programs to understand not just *, but also ? {x|y|z} and a lot of more stuff.

2) Since the shell does the globbing, you can get the globbing you want by selecting the shell you want. This wouldn't work if all the programs did their own globbing. (for example, with my current shell "wget http://site.no/*jpg" works, as does "cd ~ar*" (assuming I've got only one username starting with ar) )

The correct fix is to do away with pointless arbitrary size-limits. The kernel should accept any length argument-list, constrained only by the amount of available memory.

Quotes of the week

Posted Aug 24, 2007 19:05 UTC (Fri) by rise (guest, #5045) [Link]

I'm curious which shell you're using that does expansion of urls over http - are you sure it's not just that you've got a wget version that does globbing? If it's the former I'm torn between thinking it's kind of cool and remarkably braindead.

Globbing in shell vs application program

Posted Aug 25, 2007 18:57 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

You don't duplicate the globbing code in every program; you just have the program call the glob() library function (POSIX) on the arguments that it knows to be file specifications.

It's more powerful, because the shell can't tell an argument was meant to be a list of files, thus sometimes producing weird results. In 'cp', if you mean to copy 10 directories into an 11th directory, and forget the destination argument, it copies the first 9 directories into the 10th. If 'cp' did the globbing, it would tell you clearly you forgot the destination argument.

You can still choose your globbing universally by choosing your library search path or maybe with environment variables glob() understands.

It's the same model as the readline library, which makes filename completion work the same in all programs that have command prompts.

There are times that I find the globbing to be none of the program's business, so I appreciate the shell doing it, and others where the program understands the globbing requirements better than the shell could, and I don't. I'd like to have both.

Quotes of the week

Posted Aug 23, 2007 9:14 UTC (Thu) by james (subscriber, #1325) [Link]

Of course, classic DOS (pre Win95 OSR2) can't delete more than 65535 local files...

Quotes of the week

Posted Aug 26, 2007 5:07 UTC (Sun) by nlucas (subscriber, #33793) [Link]

Not a very good argument. One can answer modern operating systems have long filename support and I'm sure if you use long filenames on your mp3 collection you would hit this limit much sooner on Linux (and this assuming your application actually knows how to handle filenames with spaces, which seems to be a *nix minority).

Any way, pre-Win95 OSR2 wasn't that far from the first DOS version to actually allow more than 1024 entries (or was it 512?) on the root directory.

They are all idots, except Paolo Ornati

Posted Aug 23, 2007 18:27 UTC (Thu) by mdhirsch (guest, #5924) [Link]

Okay, Marc was pretty stupid in his post when he blamed the problem on using vi, but he was dead on when he pointed out there was a problem. It is an annoyance and one that DOS doesn't have. Granted, DOS has many others that Linux doesn't have, but in this particular case Marc was right.

All the people writing back that it isn't a problem were wrong. The ones who explained how it is necessary and can't be changed sounded good, until Paolo Ornati fixed it. If you read the whole thread, a change was checked in that solved Marc's problem, thus proving Marc's critics were doubly wrong. Once wrong for saying there was no problem and twice wrong for saying it couldn't be fixed.

So the only one looking good here is Paolo who fixed a long standing annoyance. I think almost everyone owes a debt of thanks to Marc to pointing out, in however a stupid way, a problem that we've all been living with and ignoring because we thought it was impossible to fix.

Michael

FYI, solved already

Posted Aug 23, 2007 18:54 UTC (Thu) by mingo (subscriber, #31122) [Link]

FYI, the solution/fix for this is already upstream and will be in v2.6.23. (the change makes execve() argument space unlimited.)

FYI, solved already

Posted Aug 23, 2007 22:12 UTC (Thu) by bronson (subscriber, #4806) [Link]

And, from the department of cosmic coincidences, the patch was written just a about one month before all this blowup. That makes the discussion useless AND moot. :)

FYI, solved already

Posted Aug 24, 2007 6:39 UTC (Fri) by mingo (subscriber, #31122) [Link]

And, from the department of cosmic coincidences, the patch was written just a about one month before all this blowup. That makes the discussion useless AND moot. :)

The concept itself (of making exec() arguments unlimited) has been in the works for years literally - this latest (and finally successful!) implementation from Ollie Wild (@Google) was written and first posted last year, it went through several iterations until it got merged upstream more than a month ago:


 commit b6a2fea39318e43fee84fa7b0b90d68bed92d2ba
 Author: Ollie Wild < aaw@google.com>
 Date:   Thu Jul 19 01:48:16 2007 -0700

    mm: variable length argument support
    
    Remove the arg+env limit of MAX_ARG_PAGES by copying the strings directly from
    the old mm into the new mm.
    
    We create the new mm before the binfmt code runs, and place the new stack at
    the very top of the address space.  Once the binfmt code runs and figures out
    where the stack should be, we move it downwards.
    
    It is a bit peculiar in that we have one task with two mm's, one of which is
    inactive.

That indeed makes the flamewa^H^H discussion useless and moot, on a cosmic scale ;-)

The code itself is quite nontrivial, as it touches a very critical (and complex) piece of kernel code, and because assumptions around the old limit were deeply embedded in the exec() code:

 15 files changed, 554 insertions(+), 453 deletions(-)

which explains why this enhancement took years. Kudos to Ollie!

FYI, solved already

Posted Aug 27, 2007 12:01 UTC (Mon) by liljencrantz (guest, #28458) [Link]

Thanks for this explanation. Like so many others, I've been muttering about how someone (not me) should have fixed this _years_ ago, and how stupid it is that such an obvious design defect is allowed to remain in place for years. And yet I've never lifted a finger to do anything about it.

I'm left wondering if there is some fundamental mistake in the overall design of exec(), though, if such a simple addition snowballs into such a huge patch.

agreed

Posted Aug 23, 2007 23:11 UTC (Thu) by xorbe (subscriber, #3165) [Link]

> They are all idots, except Paolo Ornati

No kidding, what was that thread some sort of trolling contest? I think the original post (vi/rm) was supposed to be tongue-in-check humor that snowballed.

I always thought the error was from the shell (bash/tcsh) -- but I guess I learned today the kernel was the limiting factor. Curious, that!

agreed

Posted Aug 24, 2007 11:40 UTC (Fri) by nix (subscriber, #2304) [Link]

Well, the error *is* from the shell: the shell is reporting a kernel-originated error (and helpfully claiming in the error message that it's the child process, just to add more confusion).

They are all idots, except Paolo Ornati

Posted Aug 25, 2007 19:08 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

Okay, Marc was pretty stupid in his post when he blamed the problem on using vi

LWN readers seem to have totally missed Marc's point about the vi connection. He's saying that most early Unix developers, probably including the designer of rm, used vi, and vi causes brain damage, thus the designer of rm was brain damaged, and that explains the design defect in rm.

We know now that the design defect (if any) is in the kernel, not rm, but the vi connection still holds.

(I've heard this vi theory before).

They are all idots, except Paolo Ornati

Posted Aug 26, 2007 0:55 UTC (Sun) by bronson (subscriber, #4806) [Link]

Wow, you're right! I'm getting worried... How much exposure is considered harmful? Since vi is installed just about everywhere, I sure hope exposure fractionates!

At least Emacs+Viper is safe, right?

They are all idots, except Paolo Ornati

Posted Aug 30, 2007 18:21 UTC (Thu) by anton (guest, #25547) [Link]

vi/ex only came into play with 1BSD in 1977, so none of the early Unix developers could have used it; and I think they usually did not have glass ttys, but used real ttys (the printing sort), so vi mode was not an option anyway.

Putting arbitrary limits in everything was a standard design policy in Unix (and outside of Unix) at the time. Note that the GNU Coding standards found it necessary to explicitly rule this out. It seems that this idea has gained such acceptance that people find it hard to imagine the old days.

They are all idots, except Paolo Ornati

Posted Oct 30, 2007 18:13 UTC (Tue) by ornati (guest, #48773) [Link]

Side note: I've fixed nothing. I merely pointed out the commit with the fix.  :)

Talking about editor ...

Posted Aug 23, 2007 23:37 UTC (Thu) by djrom (guest, #26074) [Link]

Another "Quote of the week" is going on on this same thread already (albeit it should be noted that the quotation might have be tailored to influence the jury, so it may not count as a legitimate entry):
so enlighten us. What editor do you use/suggest/push?
-- Randy Dunlap

And the answer:
Corbet !
-- Xavier Bestel

Counter question

Posted Aug 25, 2007 15:17 UTC (Sat) by berntsen (guest, #4650) [Link]

Simple question,

o why can't a path on windows XP be deleted if it is more than 256 characters long? (seemingly an old problem, I just found this link documenting it: http://support.microsoft.com/kb/205345)

Simple follow up:

o and why can't del from cmd.exe do it either?

But I guess the real question, when there are such limits built into del and the file explorer, why is it allowed to make such 'deep' structures in the first place?

Btw., one solution I found is to go into the directory structure as deep as you can get (cd), move the rest out of the deep structure, go out and delete the tree you came from, then do the same trick on the remainder that was moved out, for as many times as it takes.

For the curious, it was triggered by a run-loose maven2 command.

Sigh.
/\/ikolaj

P.S. Soon, very soon, I will return to linux on my worktop :D

Quotes of the week

Posted Aug 25, 2007 21:34 UTC (Sat) by akapoor (guest, #25351) [Link]

Oh come on ! This one is waaaay better:

My cat thinks outside the box all the time. Cleaning it up is a real
pain.

Quotes of the week

Posted Aug 25, 2007 21:42 UTC (Sat) by foom (subscriber, #14868) [Link]

Link to above quote:
http://lkml.org/lkml/2007/8/18/138

Biggest problem with Unix

Posted Aug 31, 2007 9:36 UTC (Fri) by honne (guest, #23487) [Link]

http://interviews.slashdot.org/article.pl?sid=04/10/18/11...

Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds