FileHooks Not working

I have created a new app NotesTutorial

The code for lib/Hook.php is

namespace OCA\NotesTutorial;

use OCP\Util;

class Hooks {

public static function connectHooks() {
\OCP\Util::connectHook(‘OC_Filesystem’, ‘post_create’, ‘OCA\NotesTutorial\Hooks’, ‘post_create’);
\OCP\Util::connectHook(‘OC_User’, ‘post_login’, ‘OCA\NotesTutorial\Hooks’, ‘post_login’);
}

public static function c( $params ) {
$myfile = fopen("/home/sanjay/test/post_create.txt", “w”);
$txt = "File Hooks post_create ";
fwrite($myfile, $txt);
}

public static function post_login($params) {
$myfile = fopen("/home/sanjay/test/post_login.txt", “w”);
$txt = “Post Login Hook is called …”;
fwrite($myfile, $txt);
}
}

User hook post_login is called but file hook post_create is not working.

The app is enabled.

Hello!
I am facing the same problem.
Have you tried putting



in your appinfo/info.xml?
This seems to be necessary for the filehooks to work, and is not really documented well.
For a lot of people it resolves the issue, (for me however it doesn’t.)
So if anyone has some other tipps it would be nice to share them here,

Hello Roland,

Yes there is info.xml in appinfo.
(user hooks working but file hooks not)

As see now, xml in my answer was not displayed correctly, sry for that.
you have to put
<types>
<filesystem/>
</types>

in your in info.xml