Jump to content

WireTempDir folder


matjazp
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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 ?

 

screenshot-1.jpg.88a8e70db0e898baff6b61a4396361f8.jpg

 

Maybe you have some screenshots ?

 

Link to comment
Share on other sites

@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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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, "/\\") . "/"; ?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...