unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Packages for file-finding & disk-usage
@ 2015-01-19  1:46 Robert Thorpe
  2015-01-20 11:16 ` Sharon Kimble
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Thorpe @ 2015-01-19  1:46 UTC (permalink / raw)
  To: help-gnu-emacs

I'm looking for two packages.  I don't know if anything exists for these
use cases:

* HTML dependency finding.

I often write webpages.  I work by saving files in a tree of directories
used by a web-server.  Given "<a href=".../foo.html">Foo</a>" in a
HTML file, I'd like to be able to easily tell if foo.html exists.  For
example to put point on it and see a message in the echo area like "file
exists" or "file not found".  Is there a package to do that?

* Disk usage.

I'm looking for a tool to monitor disk-usage.  I want to know things
like how much space the files in a particular directory take up.  Also,
what type of files use what amount of space.  Is there a way of doing
that within Emacs?

BR,
Robert Thorpe



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Packages for file-finding & disk-usage
  2015-01-19  1:46 Packages for file-finding & disk-usage Robert Thorpe
@ 2015-01-20 11:16 ` Sharon Kimble
  0 siblings, 0 replies; 3+ messages in thread
From: Sharon Kimble @ 2015-01-20 11:16 UTC (permalink / raw)
  To: Robert Thorpe; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2506 bytes --]

> I'm looking for two packages.  I don't know if anything exists for these
> use cases:
>
> * HTML dependency finding.
>
> I often write webpages.  I work by saving files in a tree of directories
> used by a web-server.  Given "<a href=".../foo.html">Foo</a>" in a
> HTML file, I'd like to be able to easily tell if foo.html exists.  For
> example to put point on it and see a message in the echo area like "file
> exists" or "file not found".  Is there a package to do that?
>
> * Disk usage.
>
> I'm looking for a tool to monitor disk-usage.  I want to know things
> like how much space the files in a particular directory take up.  Also,
> what type of files use what amount of space.  Is there a way of doing
> that within Emacs?
>
Robert.

I use this script, called "backsize", run from a cron job to monitor my backups and
seeing their size -

--8<---------------cut here---------------start------------->8---
#!/bin/bash
# to get back-up directories size

file=~/cron/backshow

if ! >$file; then
        echo "Error: Access issue while creating file";
        exit 1;
fi

function ComposeFile() { #arg1 friendly_name; arg2 dir
        size_kb=`(du -s $2 | awk '{print $1}') 2>/dev/null`;
        if [ -n "${size_kb}" ]; then
                #calculate into gb with 2 floting ponts controlled by scale
                gb=`echo "scale=2; $size_kb / 1024 / 1024" | bc -l`;
                #if you need wider columns change 25 into i.e. 35
                printf '%-20s %-20s\n' "$1" "${gb}gb" >> $file
        fi
}
# ComposeFile doesnt_exist /dummy
ComposeFile obnam-home /media/boudiccas/back1/obnam-home
ComposeFile music /media/boudiccas/back1/obnam-back4

sed -i '$!N;s/\n/ /' $file
cat $file

exit 0;
--8<---------------cut here---------------end--------------->8---

This then emails me the results when it runs -

--8<---------------cut here---------------start------------->8---
From: root@london (Cron Daemon)
Subject: Cron <boudiccas@london> /home/boudiccas/bin/backsize
To: boudiccas@localhost
Date: Tue, 20 Jan 2015 10:03:42 +0000 (1 hour, 10 minutes, 54 seconds ago)

obnam-home           406.64gb             obnam-back4                250.72gb 
--8<---------------cut here---------------end--------------->8---

Does it help?

Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
my git repo = https://bitbucket.org/boudiccas/dots
TGmeds = http://www.tgmeds.org.uk
Debian testing, fluxbox 1.3.6, emacs 24.4.1.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Packages for file-finding & disk-usage
       [not found] <mailman.18118.1421631988.1147.help-gnu-emacs@gnu.org>
@ 2015-01-22 21:01 ` sokobania.01
  0 siblings, 0 replies; 3+ messages in thread
From: sokobania.01 @ 2015-01-22 21:01 UTC (permalink / raw)
  To: help-gnu-emacs

Le lundi 19 janvier 2015 02:46:31 UTC+1, Robert Thorpe a écrit :
> I'm looking for two packages.  I don't know if anything exists for these
> use cases:
> 
> * HTML dependency finding.
> 
> I often write webpages.  I work by saving files in a tree of directories
> used by a web-server.  Given "<a href=".../foo.html">Foo</a>" in a
> HTML file, I'd like to be able to easily tell if foo.html exists.  For
> example to put point on it and see a message in the echo area like "file
> exists" or "file not found".  Is there a package to do that?

In the file ffap.el, there is a function called "find-file-at-point" which I usually bind to C-x C-f
So, when I click inside a filename and press C-x C-f, if the file exists, then I see it in the minibuffer.
The real job is done by the functions called by "ffap-guesser".


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-22 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19  1:46 Packages for file-finding & disk-usage Robert Thorpe
2015-01-20 11:16 ` Sharon Kimble
     [not found] <mailman.18118.1421631988.1147.help-gnu-emacs@gnu.org>
2015-01-22 21:01 ` sokobania.01

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).