matjazp Posted September 14, 2018 Posted September 14, 2018 There is /site/assets/WireTempDir folder. There is a bunch of empty folders with random names, starting with a dot, eg. .PFM0O90222400 1521174131OsICtIiGFJdM What is the purpose of those folders? Can they be deleted? Also, there is a folder .ProcessModuleInstall and a message in /site/assets/logs/wire-temp-dir.txt: 2018-09-14 05:02:39 admin http://localhost/processwire/module/download/ Unable to remove: C:/inetpub/wwwroot/site/assets/cache/WireTempDir/.ProcessModuleInstall/ I guess it is related to windows environment.
pwired Posted September 14, 2018 Posted September 14, 2018 Hi, Matjazp I use windows and I don't have those folders in my /site/assets/ path About /assets/cache/WireTempDir, I can move it, copy it, delete it and recreate it Can you tell us what Processwire version you are using ? What windows version ? Are you logged in with a windows administrator account ? What windows development stack are you using ? Can you check under properties, who is the owner of that WireTempDir directory under /assets/cache/ ? And what rights does that owner have ? Maybe you have some screenshots ?
matjazp Posted September 14, 2018 Author Posted September 14, 2018 @pwired thx for response. Using latest dev PW, Win 8.1 Pro with IIS, logged as local admin, have the rights to this folder, the owner is IUSR (user running web server on IIS), permissions looks ok. I don't have access to my home computer right now, but will report back later with the update. Maybe there is a problem deleting a file/folder starting with dot on windows?
pwired Posted September 14, 2018 Posted September 14, 2018 Quote Maybe there is a problem deleting a file/folder starting with dot on windows? If the owner is the windows system you can´t delete it. In that case you have to change the owner of that directory to a user who is logged in as an administrator, and give it full permissions. I am on the road right now, I will do a Processwire install later on and check if I see those folders and files somewhere.
matjazp Posted September 14, 2018 Author Posted September 14, 2018 This error message: Unable to remove: C:/inetpub/wwwroot/site/assets/cache/WireTempDir/.ProcessModuleInstall/ is issued in WireTempDir.php in line 290 when calling $this->rmdir() method in the WireTempDir.php when an module is installed or updated: protected function rmdir($dir, $recursive = false) { $dir = rtrim($dir, "/\\") . DIRECTORY_SEPARATOR; if(!is_file($dir . self::hiddenFileName)) return false; unlink($dir . self::hiddenFileName); return $this->wire('files')->rmdir($dir, $recursive); } When I commented if(!is_file($dir . self::hiddenFileName)) return false; all those temp files starting with dot got deleted. And .ProcessModuleInstall folder along with the WireTempDir also got deleted. If I again uncomment above line and the install a module, WireTempDir is created, the file .wtd is there and .ProcessModuleInstall folder is created and the error is again present. I'm not sure if this is intended behavior? Also, $dir contains forward slashes so $dir = rtrim($dir, "/\\") . DIRECTORY_SEPARATOR; should be $dir = rtrim($dir, "/\\") . "/"; ?
matjazp Posted September 15, 2018 Author Posted September 15, 2018 It also looks that $files->rmdir() method (in WireFileTools.php) could/should check if $path is provided with trailing slash or not. When this method iterates over the directory in recursive mode, the $pathname contains two slashes. But it still manages to delete the folder, php takes care of that...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now