server
server copied to clipboard
Getting the Created Item Type
Hi, I'm following the code here to get the type file or folder that I have created, but it didn't work
<?php
$test3 = \OC\Files\Filesystem::is_dir('$path');
if($test3){
$this->logbasic(sprintf("DIR WORKED"));
} else {
$this->logbasic(sprintf("DIR DIDNT"));
}
but the code above keeps returning false, how the path should look like? since to example was written, any idea how to solve it? thanks
I was using the returned value of the function internal path, it turned out that the returned path has the word files and additional characters on the path, for example instead of /test/test2/folder the internal path is files\/test\/test2\/folder
so internal path need formatting before it can actually be used