home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / scrconf / run_df.scr < prev    next >
Encoding:
Text File  |  2006-11-29  |  1.5 KB  |  71 lines

  1. /**
  2.  * File:
  3.  *   run_df.scr
  4.  * Summary:
  5.  *   SCR Agent for reading the result from /bin/df -P
  6.  * Access:
  7.  *   read-only
  8.  * Authors:
  9.  *   Unknown <yast2-hacker@suse.de>
  10.  * See:
  11.  *   anyagent
  12.  *   libscr
  13.  *   man df
  14.  * Example:
  15.  *   Read(.run.df)
  16.  *   ([$["dummy":"on", 
  17.  *       "free":"Available", 
  18.  *       "name":"Mounted", 
  19.  *       "prz":"Capacity", 
  20.  *       "spec":"Filesystem", 
  21.  *       "used":"Used", 
  22.  *       "whole":"1024-blocks"], 
  23.  *     $["free":"2170396", 
  24.  *       "name":"/", 
  25.  *       "prz":"75%", 
  26.  *       "spec":"/dev/sda3", 
  27.  *       "used":"6496372", 
  28.  *       "whole":"8666768"], 
  29.  *     $["free":"18715", 
  30.  *       "name":"/boot", 
  31.  *       "prz":"16%", 
  32.  *       "spec":"/dev/sda1", 
  33.  *       "used":"3382", 
  34.  *       "whole":"23300"], 
  35.  *   ])
  36.  * 
  37.  * $Id: run_df.scr 13018 2003-12-11 12:52:53Z jhumpol $
  38.  *
  39.  * Returns a <b>list of maps</b>. Each map (list-entry) corresponds 
  40.  * with one mount.
  41.  * Keys for the maps are: "spec", "whole", "used", "free", "prz", "name", 
  42.  * "dummy"
  43.  */
  44. .run.df
  45.  
  46. `ag_anyagent(
  47.   `Description (
  48.       (`Run("/bin/df -P")),        // real file name
  49.       "\n",            // Comment
  50.       true,            // read-only
  51.       (`List (
  52.     `Tuple (
  53.       `spec (`String("^\t ")),
  54.       `Separator ("\t "),
  55.       `whole (`String("^\t ")),
  56.       `Separator ("\t "),
  57.       `used (`String("^\t ")),
  58.       `Separator ("\t "),
  59.       `free (`String("^ \t")),
  60.       `Separator ("\t "),
  61.       `prz (`String("^ \t")),
  62.       `Separator ("\t "),
  63.       `name (`String("^ \t\n")),
  64.       `Optional(`Whitespace()),
  65.       `Optional(`dummy (`String("^ \t\n")))
  66.     ),
  67.     "\n"
  68.       ))
  69.     )
  70. )
  71.