Path: utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!YALE.ARPA!ram-ashwin From: ram-ashwin@YALE.ARPA (Ashwin Ram) Newsgroups: gnu.emacs Subject: Re: A find-file Hack Message-ID: <8810251636.AA10923@ELI.CS.YALE.EDU> Date: 25 Oct 88 16:36:54 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: Ram-Ashwin@yale.arpa (Ashwin Ram) Distribution: gnu Organization: GNUs Not Usenet Lines: 20 > From: amdahl!daveemme@AMES.ARC.NASA.GOV (Dave Emme) > > Here's a little bit of code to be run as a "find-file-hook". It runs the > UNIX command "ls -l" on the filename being visited and places the result in > the message line. This gives you the file size, date last modified, > file permissions, etc. automatically. This is a nice idea. However, using call-process to invoke /bin/ls is, I think, overkill; it is too slow and not portable to non-Unix systems. You can get the same information by calling the file-attributes function and formatting the result appropriately. On my machine this is a lot faster. This would also be portable if file-attributes has been written to call the appropriate system functions on different systems, which I assume it has. -- Ashwin. ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin BITNET: Ram@yalecs