From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: emacs & MAXPATHLEN Date: Sat, 30 Jul 2005 19:44:19 -0400 Message-ID: References: <87fytzj6a7.fsf@gmail.com> <87pst2h35e.fsf@gmail.com> <87r7dhxenv.fsf@gmail.com> <1122724400.456845.1155.nullmailer@Update.UU.SE> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1122768108 2093 80.91.229.2 (31 Jul 2005 00:01:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2005 00:01:48 +0000 (UTC) Cc: eliz@gnu.org, gscrivano@gmail.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 31 02:01:38 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dz1GZ-0006XY-Ad for ged-emacs-devel@m.gmane.org; Sun, 31 Jul 2005 02:01:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dz1J8-00059Z-Es for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 20:03:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dz1H2-00047e-D0 for emacs-devel@gnu.org; Sat, 30 Jul 2005 20:01:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dz1Gw-000447-Nm for emacs-devel@gnu.org; Sat, 30 Jul 2005 20:01:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dz1Gv-00040r-Bs for emacs-devel@gnu.org; Sat, 30 Jul 2005 20:01:41 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dz1Cr-0005xR-03 for emacs-devel@gnu.org; Sat, 30 Jul 2005 19:57:29 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1Dz107-0002Y8-2g; Sat, 30 Jul 2005 19:44:19 -0400 Original-To: ams@gnu.org In-reply-to: <1122724400.456845.1155.nullmailer@Update.UU.SE> (ams@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41359 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41359 If MAXPATHLEN is defined, it should be respected, if you try to use a file name that is longer than MAXPATHLEN then the behaviour of the system is undefined. It's better to try to get the cwd than not try. It might work. And if it doesn't, we have lost nothing. Someone wrote: In my opinion it is better to alloc directly MAXPATHLEN+1 bytes when that limit exists without entering the loop and use multiple reallocations. It's best to keep the code simple, all else being equal, and reduce the number of conditionals. Eliz wrote: ??? How can a file name on a system be ever longer than MAXPATHLEN, which is a system-dependent limit? Do mkdir -p /a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z, then rename each directory one by one from the bottom upward to a long name, and whoopee! This was first done on Multics, and resulted in a file that could not be deleted except by renaming the directories back to short names, from the top down. I think it was called a Frankston bush.