Function: gnus-cache-update-file-total-fetched-for

gnus-cache-update-file-total-fetched-for is a byte-compiled function defined in gnus-cache.el.gz.

Signature

(gnus-cache-update-file-total-fetched-for GROUP FILE &optional SUBTRACT)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-cache.el.gz
(defun gnus-cache-update-file-total-fetched-for (group file &optional subtract)
  (when gnus-cache-total-fetched-hashtb
    (gnus-cache-with-refreshed-group
     group
     (let* ((entry (or (gethash group gnus-cache-total-fetched-hashtb)
		       (puthash group (make-vector 2 0)
				gnus-cache-total-fetched-hashtb)))
	    size)

       (if file
	   (setq size (or (file-attribute-size (file-attributes file)) 0))
	 (let* ((file-name-coding-system nnmail-pathname-coding-system)
		(files (directory-files (gnus-cache-file-name group "")
					t nil t))
		file attrs)
	   (setq size 0.0)
	   (while (setq file (pop files))
	     (setq attrs (file-attributes file))
	     (unless (file-attribute-type attrs)
               (incf size (float (file-attribute-size attrs)))))))

       (setq gnus-cache-need-update-total-fetched-for t)

       (incf (nth 1 entry) (if subtract (- size) size))))))