10 years agonindim created job000149 for P4Connect does not detect changes to files saved from script, causing the file save to fail given that the file is still read only. I include here... a copy of an e-mail I sent to the main technical support e-mail address, it seems like it would be a better fit here though. Apologies if it has already been migrated. "Hi, We recently started using P4Connect, the integration with Unity is great! I wonder whether you could help me with the one issue we do have that is hampering our workflow somewhat. We make use of 2DToolkit to create texture atlases, these files are generated from script. As the atlas files are already checked in and thus read only, the script is having issues writing to the file. // Write filled atlas to disk byte[] bytes = tex.EncodeToPNG(); System.IO.FileStream fs = System.IO.File.Create(texturePath); fs.Write(bytes, 0, bytes.Length); fs.Close(); This code gives the following error in the Unity console: UnauthorizedAccessException: Access to the path <Path to file here> is denied. I can modify the code that writes to the file to remove the read only flag and this allows the file to be written to, but this does not trigger a check out operation via P4Connect. Modified code is below: // Write filled atlas to disk byte[] bytes = tex.EncodeToPNG(); // Check if readonly if (System.IO.File.Exists(texturePath)) { System.IO.FileInfo fi = new System.IO.FileInfo(texturePath); if (fi.IsReadOnly) { fi.IsReadOnly = false; } } System.IO.FileStream fs = System.IO.File.Create(texturePath); fs.Write(bytes, 0, bytes.Length); fs.Close(); We can of course check the file out manually, then perform the atlas build, but people often forget to do that and then wonder why their changes aren't showing up in game. If we remove the read only flag forcibly, then the user will often forget to check the file in and then we have a case of "It works on my machine!". Any information you can give me to help resolve this issue would be most welcome. Kind Regards" « | ||
Add a comment | ||
Adjust when notifications are sent to you about reviews that you're associated with (as an author, reviewer, project member or moderator).