<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://stlab.adobe.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://stlab.adobe.com/wiki/index.php?title=On-Disk_File_Monitor&amp;feed=atom&amp;action=history</id>
		<title>On-Disk File Monitor - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://stlab.adobe.com/wiki/index.php?title=On-Disk_File_Monitor&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://stlab.adobe.com/wiki/index.php?title=On-Disk_File_Monitor&amp;action=history"/>
		<updated>2013-05-24T13:01:33Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://stlab.adobe.com/wiki/index.php?title=On-Disk_File_Monitor&amp;diff=1453&amp;oldid=prev</id>
		<title>FosterBrereton: initial population</title>
		<link rel="alternate" type="text/html" href="http://stlab.adobe.com/wiki/index.php?title=On-Disk_File_Monitor&amp;diff=1453&amp;oldid=prev"/>
				<updated>2006-06-22T17:20:33Z</updated>
		
		<summary type="html">&lt;p&gt;initial population&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Purpose==&lt;br /&gt;
&lt;br /&gt;
The purpose of the on-disk file monitor is to serve as a controller to the client application, notifying the client app when a file on-disk has had an operation applied to it. A single file monitor instance monitors a single file for on-disk changes. Current implementations exist for Carbon and Win32. &amp;lt;code&amp;gt;file_monitor_t&amp;lt;/code&amp;gt; is available in ASL release 1.0.16 or later.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;adobe/future/file_monitor.hpp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
&lt;br /&gt;
===Free Functions and Typedefs===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
enum file_monitor_event_t&lt;br /&gt;
{&lt;br /&gt;
    file_monitor_contents_changed_k = 0,&lt;br /&gt;
    file_monitor_other_k // later expand this to deleted, moved, renamed, etc.&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the types of changes that can happen to a file on-disk that the client application might be interested in. Currently the only supported operation is notifying when the file's contents have been modified on-disk. Other operations (file moved, deleted, renamed, etc.) should be a part of the notification suite at a later date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef boost::filesystem::path file_monitor_path_type;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;file_monitor_path_type&amp;lt;/code&amp;gt; is a common associated type for the file monitor system, and is available to support the platform-specific implementation code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef boost::function&amp;lt;void (const file_monitor_path_type&amp;amp; path, file_monitor_event_t what)&amp;gt; file_monitor_callback_t;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;file_monitor_callback_t&amp;lt;/code&amp;gt; is the signature for the callback routine the file monitor system will notify when a file at a specified path is modified on-disk. The &amp;lt;code&amp;gt;what&amp;lt;/code&amp;gt; parameter enumerates what the on-disk change is, while the &amp;lt;code&amp;gt;path&amp;lt;/code&amp;gt; is the path to the file as it currently stands on disk. In future revisions of the system, this will not necessarily be the same path as the one for which the monitor was constructed (e.g., if the file was renamed, moved, or deleted, the path could change.)&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;file_monitor_t&amp;lt;/code&amp;gt; Class===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class file_monitor_t&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    file_monitor_t();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Default constructor. Wheeee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    file_monitor_t(const file_monitor_path_type&amp;amp; path, const file_monitor_callback_t&amp;amp; proc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This constructor is used to specify a path and a callback for this file monitor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    void set_path(const file_monitor_path_type&amp;amp; path);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;set_path&amp;lt;/code&amp;gt; is what the client calls if they would like to change the file to be monitored on-disk, but would like to keep the notificiation callback routine the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    void monitor(const file_monitor_callback_t&amp;amp; proc);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;monitor&amp;lt;/code&amp;gt; is what the client calls with a callback routine if they'd like to specify a new callback for this file monitor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private:&lt;br /&gt;
    file_monitor_platform_data_t plat_m;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;file_monitor_platform_data_t&amp;lt;/code&amp;gt; is a platform-specific structure and/or support code that is the implementation of file monitor for this platform. Both the declaration and the definition are implementation-defined.&lt;/div&gt;</summary>
		<author><name>FosterBrereton</name></author>	</entry>

	</feed>