Developer forum

Forum » Development » FilesAndFolders.MakeFolder seems to rid folder of permissions

FilesAndFolders.MakeFolder seems to rid folder of permissions

Jonas Mersholm
Reply

Hi,

We have some customscript taking advantage of the "FilesAndFolders.MakeFolder" method in a scheduled task. Is there any way within the "FilesAndFolders" class to check wether or not the actual folder exists, before trying to use the "MakeFolder" method? It seems like all permissions for a folder is dropped, if the MakeFolder method is called on a folder that already exists.

 

Jonas


Replies

 
Martin Vang
Martin Vang
Reply

Hi Jonas,

You should be getting a report that indicates that the folder was not created. What information does your OperationReport contain when the permissions are stripped?

Also, please specify Dynamicweb version, so I can take a look. Latest version should not do what you describe. : /

BR

Martin

 
Jonas Mersholm
Reply

Hi Martin, thank you :)

Well, i do get a report stating that it did not create the folder; which i have used so far as a sign that it already exists. The customer is complaining that the permissions are dropped sporadically, stating that it, timewise, collides with the import action. 

We are working on V. 9.2.12; but are planning to upgrade to 9.2.16 when it has been released, will this fix the issue? :) 

 

Thanks in advance,

Jonas

 
Jonas Mersholm
Reply

Bump

 
Martin Vang
Martin Vang
Reply

Hi Jonas,

That sounds fairly annoying!

I cannot help you with this problem, however. Our MakeFolder does not actually change any permissions - and if the report you get from it says, that it did not create any folder, it did not actually do any work (only did a IO.Directory.Exists check). Upgrading will have no effect on this issue, as it is not related to MakeFolder from FilesAndFolders.

I would start debugging and taking a look at when the folder loses it's permissions - you said that this was part of an import, and if you fx. import users in a way that generates new IDs, the permissions will be "dropped". The possible suspects are as many as the areas that your import-task affects.

Happy bug-hunting! smiley

BR

Martin

 

You must be logged in to post in the forum