[gameprogrammer] Re: Embedded file monitoring system?

I'm not entirely certain about this, as I haven't used boost before. But I 
would imagine they would have added some sort of support for checking 
notifications on files being changed. Because that feature exists on 
Windows, and there's a way to check the same on Linux, you would think 
they'd add that to the filesystem module.

Hmm, I'm intrigued about adding that to Ogre. Although, you'd have to create 
it as a plugin. I'm not sure everyone would want it as part of the core 
code, as it could become too processor intensive.

I know Ogre is still using devIL, so I would assume they managed to get it 
under control. But, I'm in the position you're in: Still quite a n00b when 
it comes to Ogre.

Kevin

>From: Swalrus <swalrus@xxxxxxxxxxxxxx>
>Reply-To: gameprogrammer@xxxxxxxxxxxxx
>To: gameprogrammer@xxxxxxxxxxxxx
>Subject: [gameprogrammer] Re: Embedded file monitoring system?
>Date: Fri, 29 Apr 2005 01:29:33 +0200
>
>On Fri, 2005-04-29 at 10:33 +1200, Jake Briggs wrote:
> > You could start by having a user initiated check. IE you bind a key
> > press to the "lookForAndLoadNewTextures" function. Although that does
> > avoid the more interesting part of the problem, how do you know the
> > files been changed/added.
>
>Yes, that would be a solution, but unfortunately not a funny one :P
>
> > You could just check the texture directory for its timestamp. On linux,
> > if you make a directory at 10 am, then put something in it at 10:30 am
> > the time modified omn that directory is updated also. If you modifiy a
> > file in the directory, its timestamp is also modified. You would only
> > check one thing per frame...
>
>I use Linux and I didn't know it! xD That would definitely improve
>performance in case polling was used
>
>
>Anyway, I've been diving through the Windows API, and I've found this
>very interesting function:
>HANDLE FindFirstChangeNotification(
>   LPCTSTR lpPathName,
>   BOOL bWatchSubtree,
>   DWORD dwNotifyFilter
>);
>
>It lets you wait for file changes in a specified directory (it's more or
>less what Kevin suggested).
>
>You can find this function documentation here:
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/findfirstchangenotification.asp
>and a code example here:
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/obtaining_directory_change_notifications.asp
>
>
>With this API, polling would be unnecessary in Windows (I guess I've
>just found out how did the Bungie guys manage to do it in Halo2).
>
>I will now investigate how to do this kind of thing in Linux (I've
>already read something like this in the FAM page...) and MacOSX
>
>Bye!
>
>
>
>---------------------
>To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>




---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: