Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Unanswered: Polling a directory for changes

    Is there an easy way to poll (monitor) a directory, to see if any new folders have been created in it?

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    There might be an easier way that I'm overlooking but you could do it in a fairly primitive fashion like this...

    ls -l someDirectory > originalDirectoryStatus
    while :; do
    sleep 600
    ls -l someDirectory > newDirectoryStatus
    diff originalDirectoryStatus newDirectoryStatus > directoryStatusInfo || DO_STUFF_WITH_STATUS_INFO
    mv newDirectoryStatus originalDirectoryStatus
    done

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •