[#147004] How and where Fixnum are created — "Eustaquio Rangel de Oliveira Jr." <eustaquiorangel@...>

-----BEGIN PGP SIGNED MESSAGE-----

10 messages 2005/07/01

[#147009] no clue — Joe Van Dyk <joevandyk@...>

I thought for all of five seconds for a good subject line for this

36 messages 2005/07/01
[#147028] Re: no clue — Daniel Brockman <daniel@...> 2005/07/02

Joe Van Dyk <joevandyk@gmail.com> writes:

[#151840] Re: no clue — Joe Van Dyk <joevandyk@...> 2005/08/12

On 7/1/05, Daniel Brockman <daniel@brockman.se> wrote:

[#151998] Re: no clue — Simon Krer <SimonKroeger@...> 2005/08/12

[#152051] Re: no clue — Simon Krer <SimonKroeger@...> 2005/08/13

Hi Joe,

[#152078] Re: no clue — Joe Van Dyk <joevandyk@...> 2005/08/13

On 8/13/05, Simon Krer <SimonKroeger@gmx.de> wrote:

[#152089] Re: no clue — Simon Krer <SimonKroeger@...> 2005/08/13

[#152093] Re: no clue — Joe Van Dyk <joevandyk@...> 2005/08/14

On 8/13/05, Simon Krer <SimonKroeger@gmx.de> wrote:

[#147044] Loading a file without cluttering the global namespace — Benjamin Hepp <benjamin-hepp@...>

Hello,

11 messages 2005/07/02

[#147056] class variable leading a double life — "Amarison" <amarison@...>

Can someone please explain why the @var variable leads a double life? One

20 messages 2005/07/02

[#147153] Ruby under Cygwin problems — JZ <usenet@...>

Whatever Ruby module I want to install under Cygwin I always get the same

30 messages 2005/07/04
[#147236] Re: Ruby under Cygwin problems — "karlin.fox@..." <karlin.fox@...> 2005/07/05

> No this is not the problem, it's just one more of this quick and dirty hacks (that i don't like in ruby).

[#147239] Re: Ruby under Cygwin problems — "Ryan Leavengood" <mrcode@...> 2005/07/05

karlin.fox@gmail.com said:

[#147280] Extract/Parse String? — tuyet.ctn@...

How do I extract "treeframe1120266500902" from this String class

12 messages 2005/07/06

[#147300] Inheriting Array and slice() behaviour — Sylvain Joyeux <sylvain.joyeux@...>

I have a class inheriting Array, and I expected slice() and []

43 messages 2005/07/06
[#147327] Re: Inheriting Array and slice() behaviour — Yukihiro Matsumoto <matz@...> 2005/07/06

Hi,

[#147348] Re: Inheriting Array and slice() behaviour — "Robert Klemme" <bob.news@...> 2005/07/06

William Morgan <wmorgan-ruby-talk@masanjin.net> wrote:

[#147437] Re: Inheriting Array and slice() behaviour — William Morgan <wmorgan-ruby-talk@...> 2005/07/07

Excerpts from Robert Klemme's mail of 6 Jul 2005 (EDT):

[#147443] Re: Inheriting Array and slice() behaviour — "Ara.T.Howard" <Ara.T.Howard@...> 2005/07/07

On Fri, 8 Jul 2005, William Morgan wrote:

[#147465] Re: Inheriting Array and slice() behaviour — William Morgan <wmorgan-ruby-talk@...> 2005/07/07

Excerpts from Ara.T.Howard's mail of 7 Jul 2005 (EDT):

[#147483] Re: Inheriting Array and slice() behaviour — Pit Capitain <pit@...> 2005/07/07

William Morgan schrieb:

[#147355] Major web host supports Rails — bertrandmuscle@...

One of the biggest web hosts on the internet (Dreamhost) now supports

32 messages 2005/07/06
[#147761] Re: Major web host supports Rails — Dennis Roberts <denrober@...> 2005/07/11

Want to support Ruby? Use Textdrive (http://www.textdrive.com/).

[#147421] Ruby as mathematical language — "none" <webb.sprague@...>

Hi Ruby world.

27 messages 2005/07/07

[#147504] ruby-1.8.2: test.rb: Seg Fault in test_check "exception" — me2faster@...

I reduced the sample/test.rb to just the test_check "exception"

12 messages 2005/07/07

[#147506] Ruby in XML. — John Carter <john.carter@...>

I have just stuck this on..

16 messages 2005/07/08

[#147542] Re: accessing index inside map — "Pe, Botp" <botp@...>

nobuyoshi nakada [mailto:nobuyoshi.nakada@ge.com] wrote:

26 messages 2005/07/08
[#147548] Re: accessing index inside map — "Robert Klemme" <bob.news@...> 2005/07/08

Pe, Botp wrote:

[#147651] Strings vs arrays — Luke Worth <luke@...>

Hi.

25 messages 2005/07/09
[#147670] Re: Strings vs arrays — Daniel Brockman <daniel@...> 2005/07/09

Luke Worth <luke@worth.id.au> writes:

[#147711] Programming the Lego robots using Ruby technology. — Victor Reyes <victor.reyes@...>

Do anyone knows if there is a Ruby API to program the Lego robots?

8 messages 2005/07/10
[#147712] Re: Programming the Lego robots using Ruby technology. — "daz" <dooby@...10.karoo.co.uk> 2005/07/11

[#147720] Re: accessing index inside map — "Pe, Botp" <botp@...>

Yukihiro Matsumoto [mailto:matz@ruby-lang.org] wrote:

28 messages 2005/07/11
[#147722] Re: accessing index inside map — Yukihiro Matsumoto <matz@...> 2005/07/11

Hi,

[#147790] class_attr_accessor — "Jeffrey Moss" <jeff@...>

I was playing around with class variables and class instance variables

16 messages 2005/07/11

[#147895] Updating GUIs — Joe Van Dyk <joevandyk@...>

Hi,

22 messages 2005/07/12

[#147952] Initialization via a Module — Gavin Kistner <gavin@...>

I have a module that needs to set a few instance variables on the

17 messages 2005/07/13

[#148046] Ruby has ruined my C++ — John Carter <john.carter@...>

These are exciting days in the world of C++. Every month the C/C++ User

52 messages 2005/07/13
[#148152] Re: Ruby has ruined my Java (was Re: Ruby has ruined my C++) — Kero <kero@...> 2005/07/14

> Two!

[#148497] Re: ] Re: Ruby has ruined my Java (was Re: Ruby has ruined my C++) — tony summerfelt <snowzone5@...> 2005/07/17

> After 4 years, Ruby still hasn't ruined itself.

[#148630] Re: ] Re: Ruby has ruined my Java (was Re: Ruby has ruined my C++) — mathew <meta@...> 2005/07/18

tony summerfelt wrote:

[#148709] Re: ] Re: Ruby has ruined my Java (was Re: Ruby has ruined my C++) — Daniel Amelang <daniel.amelang@...> 2005/07/18

Let's say that I have this...friend...um yea. And this 'friend' was

[#148711] Re: ] Re: Ruby has ruined my Java (was Re: Ruby has ruined my C++) — Jacob Fugal <lukfugl@...> 2005/07/18

On 7/18/05, Daniel Amelang <daniel.amelang@gmail.com> wrote:

[#148811] Re: ] Re: Ruby has ruined my Java (was Re: Ruby has ruined my C++) — Kero <kero@...> 2005/07/19

> Ha! You've reproduced my code almost exactly :)

[#148067] Ruby momentum? — Preston Crawford <me@...>

I'm an outsider to the Ruby community. I've used it a time or two,

62 messages 2005/07/14
[#148248] Re: Ruby momentum? — "gregarican" <greg.kujawa@...> 2005/07/15

Zach Dennis wrote:

[#148303] Re: Ruby momentum? — Devin Mullins <twifkak@...> 2005/07/15

Where I work (and I imagine most places), they don't bring developers on

[#148583] Re: Ruby momentum? — tsuraan <tsuraan@...> 2005/07/18

> *Actually when I've mentioned Ruby at work it's inspired more often a

[#148594] Re: Ruby momentum? — Kirk Haines <khaines@...> 2005/07/18

On Monday 18 July 2005 7:41 am, tsuraan wrote:

[#148104] difference? — G畸or SEBESTYノN <segabor@...>

Hi,

15 messages 2005/07/14

[#148229] Sampling (#39) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

97 messages 2005/07/15
[#148233] Re: [QUIZ] Sampling (#39) — James Edward Gray II <james@...> 2005/07/15

On Jul 15, 2005, at 8:00 AM, Ruby Quiz wrote:

[#148269] Re: [QUIZ] Sampling (#39) — Cassio Pennachin <pennachin@...> 2005/07/15

On 7/15/05, James Edward Gray II <james@grayproductions.net> wrote:

[#148273] Re: [QUIZ] Sampling (#39) — Jim Freeze <jim@...> 2005/07/15

* Cassio Pennachin <pennachin@gmail.com> [2005-07-16 03:04:12 +0900]:

[#148275] Re: [QUIZ] Sampling (#39) — Cassio Pennachin <pennachin@...> 2005/07/15

> Shouldn't those number be more like

[#148276] Re: [QUIZ] Sampling (#39) — Belorion <belorion@...> 2005/07/15

On 7/15/05, Cassio Pennachin <pennachin@gmail.com> wrote:

[#148284] Re: [QUIZ] Sampling (#39) — David Brady <ruby_talk@...> 2005/07/15

Belorion wrote:

[#148317] What does this construct mean? — "Casper" <caspertonka@...>

1. class MyController < ActionController::Base

22 messages 2005/07/16
[#148651] Re: What does this construct mean? — "Casper" <caspertonka@...> 2005/07/18

Devin Mullins wrote:

[#148656] Re: What does this construct mean? — "Ara.T.Howard" <Ara.T.Howard@...> 2005/07/18

On Tue, 19 Jul 2005, Casper wrote:

[#148321] Cascading <=> comparisons — Garance A Drosehn <drosihn@...>

Let's say I have a hash with some values in it, and I want to

15 messages 2005/07/16

[#148338] delaying string evaluation — Navindra Umanee <navindra@...>

Hi,

20 messages 2005/07/16
[#148339] Re: delaying string evaluation — Eric Hodel <drbrain@...7.net> 2005/07/16

On 16 Jul 2005, at 01:23, Navindra Umanee wrote:

[#148361] Re: delaying string evaluation — Navindra Umanee <navindra@...> 2005/07/16

Eric Hodel <drbrain@segment7.net> wrote:

[#148341] Just seen on c.l.py — Stephen Kellett <snail@...>

Hi Folks,

23 messages 2005/07/16
[#148418] Re: Just seen on c.l.py — ptkwt@... (Phil Tomson) 2005/07/16

In article <05th9VCgqN2CFwW4@objmedia.demon.co.uk>,

[#148357] Ruby VS PHP — Tristan Knowles <cydonia_1@...>

I was chatting with a PHP dev friend tonight, he is a

38 messages 2005/07/16
[#148396] Re: Ruby VS PHP — schlu-do@... (Dominik Schlter) 2005/07/16

Hi,

[#148384] `not' in parameter lists — Daniel Brockman <daniel@...>

I just noticed that all of the following give syntax errors:

18 messages 2005/07/16

[#148402] Nonblocking Sockets — James Edward Gray II <james@...>

Is this the "standard" way to make a nonblocking Socket in Ruby?

16 messages 2005/07/16

[#148542] Refactoring Tycho API - Opinions wanted — Hal Fulton <hal9000@...>

I've been revisiting my favorite Ruby project in the past

24 messages 2005/07/18

[#148689] Re: `not' in parameter lists — twifkak@...

On Jul 17, 2005, at 2:34 PM, Daniel Brockman wrote:

13 messages 2005/07/18

[#148721] Ruby/Rails as a starter language? — "SomeDude" <somedude@...>

Hello,

108 messages 2005/07/18
[#148736] Re: Ruby/Rails as a starter language? — vanek@... 2005/07/19

If you don't need to get involved in web programming right away, gawk

[#148743] Re: Ruby/Rails as a starter language? — James Britt <james_b@...> 2005/07/19

vanek@acd.net wrote:

[#148751] Re: Ruby/Rails as a starter language? — Navindra Umanee <navindra@...> 2005/07/19

James Britt <james_b@neurogami.com> wrote:

[#148752] Re: Ruby/Rails as a starter language? — Stefan Lang <langstefan@...> 2005/07/19

On Tuesday 19 July 2005 09:41, Navindra Umanee wrote:

[#148783] Re: Ruby/Rails as a starter language? — Mark Volkmann <r.mark.volkmann@...> 2005/07/19

On 7/19/05, Stefan Lang <langstefan@gmx.at> wrote:

[#148870] Re: Ruby/Rails as a starter language? — Hal Fulton <hal9000@...> 2005/07/19

Mark Volkmann wrote:

[#148873] Re: Ruby/Rails as a starter language? — Daniel Amelang <daniel.amelang@...> 2005/07/19

> In Java, classes aren't objects.

[#148875] Re: Ruby/Rails as a starter language? — Devin Mullins <twifkak@...> 2005/07/19

Daniel Amelang wrote:

[#148880] Re: Ruby/Rails as a starter language? — "Adam P. Jenkins" <thorin@...> 2005/07/20

Devin Mullins wrote:

[#148961] Re: [WAY OT] Re: Ruby/Rails as a starter language? — ptkwt@... (Phil Tomson) 2005/07/20

In article <Pine.LNX.4.62.0507192121430.10750@harp.ngdc.noaa.gov>,

[#148969] Re: [WAY OT] Re: Ruby/Rails as a starter language? — Rick Nooner <rick@...> 2005/07/20

On Thu, Jul 21, 2005 at 02:05:56AM +0900, Phil Tomson wrote:

[#148972] Re: [WAY OT] Re: Ruby/Rails as a starter language? — Jim Freeze <jim@...> 2005/07/20

* Rick Nooner <rick@nooner.net> [2005-07-21 02:59:56 +0900]:

[#148975] Re: [WAY OT] Re: Ruby/Rails as a starter language? — Rick Nooner <rick@...> 2005/07/20

On Thu, Jul 21, 2005 at 03:21:08AM +0900, Jim Freeze wrote:

[#148988] Re: [WAY OT] Re: Ruby/Rails as a starter language? — Jim Freeze <jim@...> 2005/07/20

* Rick Nooner <rick@nooner.net> [2005-07-21 03:57:35 +0900]:

[#148993] Re: [WAY OT] Re: Ruby/Rails as a starter language? — Rick Nooner <rick@...> 2005/07/20

On Thu, Jul 21, 2005 at 04:47:41AM +0900, Jim Freeze wrote:

[#149008] Ruby/OCaml Was Re: [WAY OT] Re: Ruby/Rails as a starter language? — Rick Nooner <rick@...> 2005/07/20

> I was just at the OCaml site,

[#148730] Memory profiling? — Scott Ellsworth <scott@...>

Hi, all.

12 messages 2005/07/19

[#148763] nil for unassigned keys — Simon Strandgaard <neoneye@...>

Sometimes I find myself writing :key=>true,

17 messages 2005/07/19

[#149035] C extension makes things slower — ptkwt@... (Phil Tomson)

In general I've always seen things speed up when I've writtten C

16 messages 2005/07/21

[#149059] Segmentation fault with a threads/forks script — Lucas Nussbaum <lucas@...>

Hi,

13 messages 2005/07/21
[#149069] Re: [BUG] Segmentation fault with a threads/forks script — "Ara.T.Howard" <Ara.T.Howard@...> 2005/07/21

On Thu, 21 Jul 2005, Lucas Nussbaum wrote:

[#149153] FreeRIDE: Where does the output go? — "basi" <basi_lio@...>

I'm trying out FreeRIDE and I have a truly embarrassing question.

15 messages 2005/07/22

[#149184] Drawing Trees (#40) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

18 messages 2005/07/22

[#149198] Abstract class or interface? — EdUarDo <eduardo.yanezNOSPAM@...>

Hi all again :),

13 messages 2005/07/22

[#149286] Local Instance Methods — "Trans" <transfire@...>

Hi All--

25 messages 2005/07/23

[#149302] Any interest in writing gui library on top of qtruby? — meruby@...

wax is a gui written on top of wxPython. It allows seamless integration

19 messages 2005/07/23

[#149322] Lisp on Lines — "luke" <lduncalfe@...>

Read on the comp.lang.lisp group that someone is developing 'Lisp on Lines'

44 messages 2005/07/24
[#149343] Re: Lisp on Lines — "Ara.T.Howard" <Ara.T.Howard@...> 2005/07/24

On Sun, 24 Jul 2005, luke wrote:

[#149366] Re: Lisp on Lines — "William James" <w_a_x_man@...> 2005/07/24

How much less powerful than Lisp is Ruby?

[#149397] Nitro + Og 0.21.0 Compiler, Og custom joins, Og dynamic injection, new builder — "George Moschovitis" <george.moschovitis@...>

Hello everyone,

13 messages 2005/07/25

[#149481] What's so special about operators, built-in classes and modules? — Jim Freeze <jim@...>

I just noticed this little quirk. Is there something

30 messages 2005/07/25

[#149490] Trying to understand symbols — "Sam Kong" <sam.s.kong@...>

Hello!

18 messages 2005/07/25

[#149515] Factory Patterns in Ruby — Lyndon Samson <lyndon.samson@...>

Factory is a very common pattern in the java world, in some places

17 messages 2005/07/26

[#149555] — "Adrian Petru Dimulescu" <adrian.dimulescu@...>

Hello,

13 messages 2005/07/26

[#149616] Next Official Ruby Version

Is it somehow planned to build a new official Ruby before Ruby 2, that means a version called 1.10 or so?

26 messages 2005/07/26

[#149654] (X)Emacs users going to RubyCOnf — Forrest Chang <fkc_email-news@...>

Hi All:

14 messages 2005/07/27

[#149720] Re: What's so special about operators, built-in classes and modules? — twifkak@...

>Then you will have complex network of classes instead of simple tree

56 messages 2005/07/27
[#149765] Re: What's so special about operators, built-in classes and modules? — Daniel Brockman <daniel@...> 2005/07/28

gabriele renzi <surrender_it@remove-yahoo.it> writes:

[#149770] Re: What's so special about operators, built-in classes and modules? — Yukihiro Matsumoto <matz@...> 2005/07/28

Hi,

[#149772] Re: What's so special about operators, built-in classes and modules? — Devin Mullins <twifkak@...> 2005/07/28

Yukihiro Matsumoto wrote:

[#149773] Re: What's so special about operators, built-in classes and modules? — Yukihiro Matsumoto <matz@...> 2005/07/28

Hi,

[#149776] Re: What's so special about operators, built-in classes and modules? — Devin Mullins <twifkak@...> 2005/07/28

Yukihiro Matsumoto wrote:

[#149905] Re: What's so special about operators, built-in classes and modules? — Daniel Brockman <daniel@...> 2005/07/28

Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#149783] Ruby in embedded applications — "treefrog" <stephen.hill@...>

Hi folks,

14 messages 2005/07/28

[#149793] Idea for Ruby 2.0 — Nikolai Weibull <mailing-lists.ruby-talk@...>

Lately I've found myself using pseudo-anonymous variables a lot, e.g.,

24 messages 2005/07/28

[#149801] Combination of two arrays — Claus Spitzer <docboobenstein@...>

Greetings!

18 messages 2005/07/28

[#149876] Linux Journal article on Ruby — pat eyler <pat.eyler@...>

http://www.linuxjournal.com/article/8356 it's always nice to see another

13 messages 2005/07/28

[#149968] Which Regex-Engine will be used in Ruby 1.8.3 Release?

One short question.

12 messages 2005/07/29

[#149982] Chopping the beginning of a string elegantly — "francisrammeloo@..." <francisrammeloo@...>

Hi all,

13 messages 2005/07/29

[#150133] Ruby-Python; using python from within ruby — "Norjee" <Norjee@...>

At the moment I'm looking at rails, it seems like a great framework.

13 messages 2005/07/30

[#150154] Ruby-Oniguruma interoperability on Named Groups

Let me first explain the reason for and the kind of this message.

10 messages 2005/07/30

[#150205] Yet Another useless Ruby 2 Idea — gabriele renzi <surrender_it@...>

Hi gurus and nubys,

69 messages 2005/07/31
[#150680] Re: Yet Another useless Ruby 2 Idea — Daniel Brockman <daniel@...> 2005/08/04

Jeff Wood <jeff.darklight@gmail.com> writes:

[#150684] Re: Yet Another useless Ruby 2 Idea — Austin Ziegler <halostatue@...> 2005/08/04

On 8/3/05, Daniel Brockman <daniel@brockman.se> wrote:

[#150688] Re: Yet Another useless Ruby 2 Idea — Jeff Wood <jeff.darklight@...> 2005/08/04

I'm not saying there are NO features of python that are cool... I like

[#150860] Re: Yet Another useless Ruby 2 Idea — gabriele renzi <surrender_it@...> 2005/08/05

Jeff Wood ha scritto:

[#150899] Re: Yet Another useless Ruby 2 Idea — Jacob Fugal <lukfugl@...> 2005/08/05

On 8/5/05, gabriele renzi <surrender_it@remove-yahoo.it> wrote:

[#150910] Re: Yet Another useless Ruby 2 Idea — gabriele renzi <surrender_it@...> 2005/08/05

Jacob Fugal ha scritto:

[#151275] Re: Yet Another useless Ruby 2 Idea — mathew <meta@...> 2005/08/08

gabriele renzi wrote:

[#151354] Re: Yet Another useless Ruby 2 Idea — gabriele renzi <surrender_it@...> 2005/08/09

mathew ha scritto:

Re: Hotfolders or "watched" folders in Ruby?

From: "Ara.T.Howard" <Ara.T.Howard@...>
Date: 2005-07-21 15:23:23 UTC
List: ruby-talk #149081
On Thu, 21 Jul 2005, gabriele renzi wrote:

> Ara.T.Howard ha scritto:
>  plus dirwatch is really designed to setup a processing system
>> which runs external programs on files as they arrive in directories vs.
>> running a ruby block or some such.
>
> I don't know the internals nor the api for dirwatch, but could ypu explain
> where the difference would be ?

well, dirwatch is an application vs. and api.  so you don't have something
like

   open('directory').on('created') do |file|
     puts "#{ file } created"
   end

or however you might imagine an api for watching directory events...


with dirwatch, which is a command line tool, you'd do something like this to
setup a watch

   ~ > dirwatch some_directory create

this initializes an sqlite database, config files, log files, generates sample
scripts, etc.  all this will end up in ./some_directory/.dirwatch/.  example:

   jib:~ > mkdir some_directory

   jib:~ > dirwatch some_directory/ create
   ---
   /home/ahoward/some_directory:
     dirwatch_dir : /home/ahoward/some_directory/.dirwatch
     db           : /home/ahoward/some_directory/.dirwatch/db
     logs_dir     : /home/ahoward/some_directory/.dirwatch/logs
     config       : /home/ahoward/some_directory/.dirwatch/dirwatch.conf
     commands_dir : /home/ahoward/some_directory/.dirwatch/commands


if we peeked in dirwatch.conf we'd see something like
   ...
   ...
   ...
     actions:
       updated :
         -
           command: simple.sh
           type: simple
           pattern: ^.*$
           timing: sync
         -
           command: yaml.rb
           type: simple
           pattern: ^.*$
           timing: sync
   ...
   ...
   ...

(did i mention i love yaml? ;-) )

the 'actions' section is where you setup what to do on certain events.  the
possible events are 'created', 'modified', 'deleted', or 'existing' (all of
which are pretty obvious) and the action 'updated' which is the union of
'created' or 'modified'.  so this config is saying that, whenever a file is
updated we'll run two commands 'simple.sh' and 'yaml.rb'.  note that a list of
commands can be specified - they will be run in that order.  the list of
commands themselves are configured with a few paramters

   command:

     the command to run.  the .dirwatch/commands_dir/ is pre-pended to PATH
     when running commands so it's convenient to put them there.  the
     example/auto-generated commands are in that directory.

   type:

     this is the calling convention.  for example simple commands are called
     like

       simple.sh file_that_was_updated mtime_of_that_file

     and is called once for each file.  yaml commands are called like

       yaml.rb < (list of __every__ updated file and it's mtime on stdin in yaml format)

     there are two other types but essentially you just have a choice - your
     script is run once with every file or it gets all the files at once on
     stdin.

   pattern:

     only files matching this regex will get passed to this command.  dirwatch
     itself has a --pattern option which causes it to see only files matching
     that pattern but that affects everything.  this is on a per command basis.
     so you might see

       updated :
         -
           command: gif2png
           type: simple
           pattern: ^.*\.gif$
           timing: sync
         -
           command: png2ps
           type: simple
           pattern: ^.*\.png$
           timing: sync

   timing:

     whether we wait for each command to finish or just spawn in the background
     and collect exit_status later.  this is extremely dangerous on systems
     that could update 1,000,000 files at once.



next you'd simply start dirwatch using

   jib:~ > dirwatch some_directory/ watch
   I, [2005-07-21T09:04:48.668571 #27750]  INFO -- : ** STARTED **
   I, [2005-07-21T09:04:48.669050 #27750]  INFO -- : config </home/ahoward/some_directory/.dirwatch/dirwatch.conf>
   I, [2005-07-21T09:04:48.669252 #27750]  INFO -- : flat <false>
   I, [2005-07-21T09:04:48.669324 #27750]  INFO -- : files_only <false>
   I, [2005-07-21T09:04:48.682278 #27750]  INFO -- : no_follow <false>
   I, [2005-07-21T09:04:48.682358 #27750]  INFO -- : pattern <>
   I, [2005-07-21T09:04:48.682461 #27750]  INFO -- : n_loops <>
   I, [2005-07-21T09:04:48.682629 #27750]  INFO -- : interval <00:05:00>
   I, [2005-07-21T09:04:48.683028 #27750]  INFO -- : lockfile </home/ahoward/some_directory/.dirwatch.lock>
   I, [2005-07-21T09:04:48.683147 #27750]  INFO -- : tmpwatch[all] <false>
   I, [2005-07-21T09:04:48.683213 #27750]  INFO -- : tmpwatch[nodirs] <false>
   I, [2005-07-21T09:04:48.683278 #27750]  INFO -- : tmpwatch[force] <true>
   I, [2005-07-21T09:04:48.683454 #27750]  INFO -- : tmpwatch[age] <30 days> == <2592000.0s>
   I, [2005-07-21T09:04:48.683530 #27750]  INFO -- : tmpwatch[rm] <rm_rf>
   ...
   ...
   ...

now, if i dropped a file into some_directory/ in another terminal:

   jib:~/some_directory > touch a

i'd see this in the terminal running dirwatch

   I, [2005-07-21T09:06:13.721967 #27839]  INFO -- : ACTION.UPDATED.0.0 - cmd : simple.sh '/home/ahoward/some_directory/a' '2005-07-21 15:05:38.000000'
   I, [2005-07-21T09:06:13.795296 #27839]  INFO -- : ACTION.UPDATED.0.0 - exit_status : 0

the 'ACTION.UPDATED.0.0' is a uniq tag that makes finding the exit_status easy
in the event that the command was run 'async' and it's exit_status ends up in
the log 4000 lines later...


when running from the console like this the stdout of the command run shows
too, so i also saw this - the output of running simple.sh - in the terminal
running dirwatch:

   dirwatch_dir: </home/ahoward/some_directory>
   dirwatch_action: <updated>
   dirwatch_type: <simple>
   dirwatch_n_paths: <1>
   dirwatch_path_idx: <0>
   dirwatch_path: </home/ahoward/some_directory/a>
   dirwatch_mtime: <2005-07-21 15:05:38.000000>
   dirwatch_pid: <27839>
   dirwatch_id: <ACTION.UPDATED.0.0>
   command_line: </home/ahoward/some_directory/a 2005-07-21 15:05:38.000000>
   path: </home/ahoward/some_directory/a>
   mtime: <2005-07-21 15:05:38.000000>


simple.sh basically just prints it's environment and the argv it was called
with, here's the whole script:

   jib:~/some_directory > cat .dirwatch/commands/simple.sh
   #!/bin/sh
   echo "dirwatch_dir: <$DIRWATCH_DIR>"
   echo "dirwatch_action: <$DIRWATCH_ACTION>"
   echo "dirwatch_type: <$DIRWATCH_TYPE>"
   echo "dirwatch_n_paths: <$DIRWATCH_N_PATHS>"
   echo "dirwatch_path_idx: <$DIRWATCH_PATH_IDX>"
   echo "dirwatch_path: <$DIRWATCH_PATH>"
   echo "dirwatch_mtime: <$DIRWATCH_MTIME>"
   echo "dirwatch_pid: <$DIRWATCH_PID>"
   echo "dirwatch_id: <$DIRWATCH_ID>"
   echo "command_line: <$@>"
   path=$1
   mtime=$2
   echo "path: <$path>"
   echo "mtime: <$mtime>"

you'll notice quite a bit of information is passed via the environment and
that the mtime is also passed in on the command line.  typical programs won't
use all this - but it's there.  'dirwatch --help' explains the meaning of
these environment variables.


so, normally you don't run like that (from the console) and instead have
something like this in your crontab to maintain an 'immortal' daemon

   */15 * * * * dirwatch /home/ahoward/some_directory watch --daemon

this does NOT start a daemon every fifteen minutes.  the daemon always sets up
of a lockfile and refuses to start if one is already running.  so, this just
makes sure exactly one daemon is running at all times - even after machine
reboots or if some bug causes dirwatch to crash.  this may seem a bit odd but
those of you that don't have root on all your boxes in the office will
understand why it can work like that - you can setup robust daemons without
any special privledges.  of course you can start it from init.d and it
supports 'start', 'stop', and 'restart' arguments too so this is trivial.

so that's it basically.  dirwatch simply scans a directory, compares what it
finds to what's in it's database (sqlite), and runs appropriate actions in the
way you've configured it to do, and then sleeps for a while.  it never stops,
automatically logs rolls, and does some other stuff too.  there's a whole lot
of options like recursing into subdirectories, ignoring anything that's not a
file, a tmpwatch like facility built-in, etc.  but you can read about that in
with --help.

cheers.

btw.  i inlined the output of --help below.  note that i just did a massive
re-write so some of this is a little off, but it's close.


-a
-- 
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| My religion is very simple.  My religion is kindness.
| --Tenzin Gyatso
===============================================================================

NAME
   dirwatch v0.9.0

SYNOPSIS
   dirwatch [ options ]+ mode [ directory = ./ ]

DESCRIPTTION
   dirwatch is a tool used to rapidly build processing systems from file system
   events.

   dirwatch manages an sqlite database that mirrors the state of a directory and
   then triggers user definable event handlers for certain filesystem activities
   such file creation, modification, deletion, etc.  dirwatch can also implement
   a tmpwatch like behaviour to ensure files of a certain age are removed from
   the directory being watched.  dirwatch normally runs as a daemon process by
   first sychronizing the database inventory with that of the directory and then
   firing appropriate triggers as they occur.

   -----------------------------------------------------------------------------
   the following actions may have triggers configured for them
   -----------------------------------------------------------------------------

   created  -> a file was detected that was not already in the database
   modified -> a file in the database was detected as being modified
   updated  -> a file was created or modified (union of these two actions)
   deleted  -> a file in the database is no longer in the directory
   existing -> a file in the database still exists in the directory and has not
               been modified

   -----------------------------------------------------------------------------
   the command line 'mode' must be one of the following
   -----------------------------------------------------------------------------

   create   (c) -> initialize the database and supporting files
   watch    (w) -> monitor directory and trigger actions in the foreground
   start    (S) -> spawn a daemon watcher in the background
   restart  (R) -> (re)spawn a daemon watcher in the background
   stop     (H) -> stop/halt any currently running watcher
   status   (T) -> determine if any watcher is currently running
   truncate (D) -> truncate/delete all entries from the database
   archive  (a) -> create a tar.gz archive of a watch's directory contents
   list     (l) -> dump database to stdout in silky smooth yaml format

   for all modes the command line argument must be the name of the directory to
   which to apply the operation - which defaults to the current directory.

   -----------------------------------------------------------------------------
   mode: create (c)
   -----------------------------------------------------------------------------

   initializes a storage directory with all required database files, logs,
   command directories, sample configuration, sample programs, etc.

   by default the storage dir will be stored in a subdirectory specfied as the
   'directory' command line argument, eg:

     directory/.dirwatch/

   the --dirwatch_dir option can be used to specify an alternate location.  this
   is particularly important to use if you, for instance, have an external
   program like tmpwatch running which might delete this directory!

   when a dirwatch storage directory is created a few files are directories are
   created underneath it.  the hierarchy is

     directory/.dirwatch/
                         commands/
                         logs/
                         db
                         dirwatch.conf
                         dirwatch.pid

    where

     commands/     -> any programs placed here will be automatically found as
                      this location is added to PATH
     logs/         -> logs are kept here and are auto-rolled to no scrubbing is needed
     db            -> this is an sqlite database file
     dirwatch.conf -> a yaml configuration file used to configure which commands
                      to trigger for which actions
     dirwatch.pid  -> a file containing the pid of the daemon process

   examples:

     0) initialize the directory incoming_data/ to be dirwatched using all
        defaults

       ~ > dirwatch create incoming_data/

     1) initialize the directory incoming_data/ to be dirwatched storing all
        metadata in /usr/local/dirwatch/incoming_data

       ~ > dirwatch create incoming_data/           --dirwatch_dir=/usr/local/dirwatch/incoming_data/

   -----------------------------------------------------------------------------
   mode: start (S)
   -----------------------------------------------------------------------------

   dirwatch is normally run in daemon mode.  the start mode is equivalent to
   running in 'watch' mode with the '--daemon' and '--quiet' flags.

   examples:

     ~ > dirwatch start incoming_data/

   -----------------------------------------------------------------------------
   mode: restart (R)
   -----------------------------------------------------------------------------

   'restart' mode checks a watcher's pidfile and either restarts the currently
   running watcher or starts a new one as in 'start' mode.  this is equivalent to
   sending SIGHUP to the watcher daemon process.

   examples:

     ~ > dirwatch restart incoming_data/

   -----------------------------------------------------------------------------
   mode: stop (H)
   -----------------------------------------------------------------------------

   'stop' mode checks for any process watching the specified directory and  kills
   this process if it exists.  this is equivalent to sending TERM to the watcher
   daemon process.  the process will not exit immediately but will do at the
   first possible safe opportunity.  do not kill -9 the daemon process.

   examples:

     ~ > dirwatch stop incoming_data/

   -----------------------------------------------------------------------------
   mode: status (T)
   -----------------------------------------------------------------------------

   'status' mode reports whether or not a watcher is running for the given
   directory.

   examples:

     ~ > dirwatch status incoming_data/

   -----------------------------------------------------------------------------
   mode: truncate (D)
   -----------------------------------------------------------------------------

   'truncate' (delete) mode atomically empties the database of all state.

   examples:

     ~ > dirwatch truncate incoming_data/

   -----------------------------------------------------------------------------
   mode: archive (a)
   -----------------------------------------------------------------------------

   archive mode is used to atomically create a tgz file of a the storage
   directory for a given directory while respecting the locking subsystem.

   examples:

     ~ > dirwatch archive incoming_data/

   essentially this is useful for making hot backups.  you system must have the
   tar command for this to operate.

   -----------------------------------------------------------------------------
   mode: watch (w)
   -----------------------------------------------------------------------------

   this is the biggie.

   dirwatch is designed to run as a daemon, updating the database inventory at
   the interval specified by the '--interval' option (5 minutes by default) and
   firing appropriate trigger commands.  two watchers may not watch the same
   dir simoultaneously and attempting the start a second watcher will fail when
   the second watcher is unable to obtain the pid lockfile.  it is a non-fatal
   error to attempt to start another watcher when one is running and this failure
   can be made silent by using the '--quiet' option.  the reason for this is to
   allow a crontab entry to be used to make the daemon 'immortal'.  for example,
   the following crontab entry

     */15 * * * * dirwatch directory --daemon --dbdir=0 \
                                     --files_only --flat \
                                     --interval=10minutes --quiet

   or (same but shorter)

     */15 * * * * dirwatch directory -D -d0 -f -F -i10m -q

   will __attempt__ to start a daemon watching 'directory' every fifteen minutes.
   if the daemon is not already running one will started, otherwise dirwatch will
     simply fail silently (no cron email sent due to stderr).

   this feature allows a normal user to setup daemon processes that not only will
   run after machine reboot, but which will continue to run after other terminal
   program behaviour.

   the meaning of the options in the above crontab entry are as follows

     --daemon     -> become a child of init and run forever
     --dbdir      -> the storage directory, here the default is specified
     --files_only -> inventory files only (default is files and directories)
     --flat       -> do not recurse into subdirectories (default recurses)
     --interval   -> generate inventory, at mininum, every 10 minutes
     --quiet      -> be quiet when failing due to another daemon already watching

   as the watcher runs and maintains the inventory it is noted when
   files/directories (entries) have been created, modified, updated, deleted, or
   are existing.  these entries are then handled by user definable triggers as
   specified in the config file.  the config file is of the format

     ...
     actions :
       created :
         commands :
           ...
       updated :
         commands :
           ...
       ...
     ...

   where the commands to be run for each trigger type are enumerated.  each
   command entry is of the following format:
         ...
         -
           command : command to run
           type    : calling convention
           pattern : filter files further by this pattern
           timing  : synchronous or asynchronous execution
         ...

   the meaning of each field is as follows:

     command: this is the program to run.  the search path for the program is
              determined dynamically by the action run.  for instance, when a
              file is discovered to be 'modified' the search path for the
              command will be

                dbdir/commands/modified/ + dbdir/commands/ + $PATH

              this dynamic path setting simply allows for short pathnames if
              commands are stored in the dbdir/commands/* subdirectories.

     type:    there are four types of commands.  the type merely indicates the
              calling convention of the program.  when commands are run there
              are two peices of information which must be passed to the
              program, the file in question and the mtime of that file.  the
              mtime is less important but programs may use it to know if the file
              has been changed since they were spawned.  mtime will probably be
              ignored for most commands.  the four types of commands fall into
              two catagories: those commands called once for each file and those
              types of commands called once with __all__ files

              each file:

                simple:  the command will be called with three arguments: the file
                         in question, the mtime date, and the mtime time. eg:

                           command foobar.txt 2002-11-04 01:01:01.1234

                expaned: the command will be have the strings '@file' and
                         '@mtime' replaced with appropriate values. eg:

                           command '@file' '@mtime'

                         expands to (and is called as)

                           command 'foobar.txt' '2002-11-04 01:01:01.1234'

              all at once:

                filter:  the stdin of the program will be given a list where each
                         line contains three items, the file, the mtime data, and
                         the mtime time.

                yaml:    the stdin of the program will be given a list where each
                         entry contains two items, the file and the mtime.  the
                         format of the list is valid yaml and the schema is an
                         array of hashes with the keys 'path' and 'mtime'.

     pattern: all the files for a given action are filtered by this pattern,
              and only those files matching pattern will have triggers fired.


     timing:  if timing is asynchronous the command will be run and not waited
              for before starting the next command.  asynchronous commands may
              yield better performance but may also result in many commands
              being run at once.  asyncronous commands should not load the
              system heavily unless one is looking to freeze a machine.
              synchronous commands are spawned and waited for before the next
              command is started.  a side effect of synchronous commands is
              that the time spent waiting may sum to an ammount of time greater
              than the interval ('--interval' option) specified - if the amount
              of time running commands exceeds the interval the next inventory
              simply begins immeadiately with no pause.  because of this one
              should think of the interval used as a minimum bound only,
              especially when synchronous commands are used.


   note that sample commands of each type are auto-generated in the
   dbdir/commands directory.  reading these should answer any questions regarding
   the calling conventions of any of the four types.  for other questions regard
   the sample config, which is also auto-generated.


   -----------------------------------------------------------------------------
   mode: list (l)
   -----------------------------------------------------------------------------

   dump the contents of the database in yaml format for easy viewing/parsing


ENVIRONMENT

   for dirwatch itself:

     export SLDB_DEBUG=1     -> cause sldb library actions (sql) to be logged
     export LOCKFILE_DEBUG=1 -> cause lockfile library actions to be logged

   for programs run by dirwatch the following environment variables will be set:

     DIRWATCH_DIR      -> the directory being watched
     DIRWATCH_ACTION   -> action type, one of 'instance', 'created', 'modified',
                          'updated', 'deleted', or 'existing'
     DIRWATCH_TYPE     -> command type, one of 'simple', 'expanded', 'filter', or
                          'yaml'
     DIRWATCH_N_PATHS  -> the total number of paths for this action.  the paths
                          themselves will be passed to the program in a different
                          way depending on DIRWATCH_TYPE, for instance on the
                          command line or on stdin, but this number will always
                          be the total number of paths the program should expect.
     DIRWATCH_PATH_IDX -> for some command types, like 'simple', the program will
                          be run more than once to handle all paths since calling
                          convention only allows the program to be called with
                          one path at a time.  this number is the index of the
                          current path in such cases.  for instance, a 'simple'
                          program may only be called with one path at a time so
                          if 10 files were created in the directory that would
                          result in the program being called 10 times.  in each
                          case DIRWATCH_N_PATHS would be 10 and DIRWATCH_PATH_IDX
                          would range from 0 to 9 for each of the 10 calls to the
                          program.  in the case of 'filter' and 'yaml' command
                          types, where every path is given at once on stdin this
                          value will be equal to DIRWATCH_N_PATHS
     DIRWATCH_PATH     -> for 'simple' and 'expanded' command types, which are
                          called once for each path, this will contain the path
                          the program is being called with.  in the case of
                          'filter' or 'yaml' command types the varible contains
                          the string 'stdin' implying that all paths are
                          available on stdin.
     DIRWATCH_MTIME    -> for 'simple' and 'expanded' command types, which are
                          called once for each path, this will contain the mtime
                          the program is being called with.  in the case of
                          'filter' or 'yaml' command types the varible contains
                          the string 'stdin' implying that all mtimes are
                          available on stdin.
     DIRWATCH_PID      -> the pid of dirwatch watcher process
     DIRWATCH_ID       -> an identifier for this action that will be unique for
                          any given run of a dirwatch watcher process.
                          restarting the watcher resets the generator.  this
                          identifier is logged in the dirwatch watcher logs to is
                          useful to match program logs with dirwatch logs
     PATH              -> the normal shell path.  for each program run the PATH
                          is modified to contain the commands dir of the dirwatch
                          watcher processs.  normally this is
                          $DIRWATCH_DIR/.dirwatch/commands/


FILES
   directory/.dirwatch/              -> dirwatch data files
   directory/.dirwatch/dirwatch.conf -> default configuration file
   directory/.dirwatch/commands/     -> default location for triggers
   directory/.dirwatch/db            -> sldb/sqlite database
   directory/.dirwatch/dirwatch.pid  -> default pidfile
   directory/.dirwatch/logs/         -> automatically rolled log files

DIAGNOSTICS
   success -> $? == 0
   failure -> $? != 0


AUTHOR
   ara.t.howard@noaa.gov


BUGS
   1 < bugno && bugno < 42

OPTIONS
   --help, -h
         this message
   --log=path, -l
         set log file - (default stderr)
   --verbosity=verbostiy, -v
         0|fatal < 1|error < 2|warn < 3|info < 4|debug - (default info)
   --config=path
         valid path - specify config file (default nil)
   --template=[path]
         valid path - generate a template config file in path (default stdout)
   --dirwatch_dir=dirwatch_dir
         specify dirwatch storage dir
   --daemon, -d
         specify daemon mode
   --quiet, -q
         be wery wery quiet
   --flat, -F
         do not recurse into subdirectories
   --files_only, -f
         consider only files
   --no_follow, -n
         do not follow links
   --pattern=pattern, -p
         consider only entries that match pattern
   --n_loops=n_loops, -N
         loop only this many times before exiting
   --interval=interval, -i
         sleep at least this long between loops
   --lockfile=[lockfile], -k
         specify a lockfile path
   --show_input, -s
         show input to all commands run


In This Thread

Prev Next