# The form data below was edited by norman_morse # Perforce Workshop Jobs # # Job: The job name. 'new' generates a sequenced job number. # Status: Job status; [open/closed/suspended]. Required # Project: The project this job is for. Required. # Severity: [A/B/C] (A is highest) Required. # ReportedBy The user who created the job. Can be changed. # ReportedDate: The date the job was created. Automatic. # ModifiedBy: The user who last modified this job. Automatic. # ModifiedDate: The date this job was last modified. Automatic. # OwnedBy: The owner, responsible for doing the job. Optional. # Description: Description of the job. Required. # DevNotes: Developer's comments. Optional. # Type: Type of job; [Bug/Feature]. Required. Job: job000149 Status: open Project: perforce-software-p4connect Severity: B ReportedBy: nindim ReportedDate: 2015/02/14 07:17:07 ModifiedBy: norman_morse ModifiedDate: 2015/10/12 17:06:23 OwnedBy: nindim Description: 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 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" DevNotes: Priority: Medium Probably a duplicate of job000095a "interact with script" Type: Feature