emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

silly precision when reporting file size


From: Chris Moore
Subject: silly precision when reporting file size
Date: Thu, 27 Oct 2005 03:21:36 +0200

I just accidentally tried to open an 800Mb file.

The resulting warning message told me the file size to 13 decimal places.

This seems to be caused by the 'file-attributes' function returning the file size as a floating point number for very large files.

I suggest using a %d format instead of a %s - then the size shown will be an integer even for big files:

  ELISP> (format "File %s is large (%sMB), really open? " "blah.txt" (/ 800000001.0 1048576))
  "File blah.txt is large (762.9394540786743MB), really open? "

  ELISP> (format "File %s is large (%dMB), really open? " "blah.txt" (/ 800000001.0 1048576))
  "File blah.txt is large (762MB), really open? "

In GNU Emacs 22.0.50.24 (i686-pc-linux-gnu, GTK+ Version 2.8.6) of 2005-10-14.

Chris.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]