Function: gnus-agent-update-files-total-fetched-for

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

Signature

(gnus-agent-update-files-total-fetched-for GROUP DELTA &optional METHOD PATH)

Documentation

Update or set total disk space used by articles that the agent has fetched.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-agent.el.gz
(defun gnus-agent-update-files-total-fetched-for (group delta
							&optional method path)
  "Update or set total disk space used by articles that the agent has fetched."
  (when gnus-agent-total-fetched-hashtb
    (gnus-agent-with-refreshed-group
     group
     ;; if null, gnus-agent-group-pathname will calc method.
     (let* ((gnus-command-method method)
	    (path (or path (gnus-agent-group-pathname group)))
	    (entry (or (gethash path gnus-agent-total-fetched-hashtb)
		       (puthash path (make-list 3 0)
				     gnus-agent-total-fetched-hashtb)))
	    (file-name-coding-system nnmail-pathname-coding-system))
       (when (file-exists-p path)
	 (when (listp delta)
	   (if delta
	       (let ((sum 0.0)
		     file)
		 (while (setq file (pop delta))
		   (cl-incf sum (float (or (file-attribute-size
					    (file-attributes
					     (nnheader-concat
					      path
					      (if (numberp file)
						  (number-to-string file)
						file))))
					   0))))
		 (setq delta sum))
	     (let ((sum (- (nth 2 entry)))
		   (info (directory-files-and-attributes
			  path nil "\\`-?[0-9]+\\'" t))
		   file)
	       (while (setq file (pop info))
		 (cl-incf sum (float (or (file-attribute-size (cdr file)) 0))))
	       (setq delta sum))))

	 (setq gnus-agent-need-update-total-fetched-for t)
	 (cl-incf (nth 2 entry) delta))))))