- Home /
VersionControl.Provider.Checkout throws chmod error, but all code works
I'm at a bit of a loss here. I'm trying to get unity to check out a file before writing to it, all of which actually works fine. Except that it throws an error:
chmod: D:\Projects\ProjectName\english.json: The system cannot find the file specified.
Here's my attempt at getting it to work properly:
UnityEditor.VersionControl.Asset asset = UnityEditor.VersionControl.Provider.GetAssetByPath(path);
UnityEditor.VersionControl.Task status = UnityEditor.VersionControl.Provider.Status(asset);
status.Wait();
if (UnityEditor.VersionControl.Provider.CheckoutIsValid(status.assetList[0]))
{
UnityEditor.VersionControl.Task task = UnityEditor.VersionControl.Provider.Checkout(status.assetList[0], UnityEditor.VersionControl.CheckoutMode.Asset);
task.Wait();
}
The error is thrown at task.Wait().
The file it's pointing to exists and in the lines after this it actually writes the correct text to the file.
Anyone got any idea what causes this?
Answer by Aceria_ · Apr 26, 2018 at 09:30 AM
Bumping this up, problem still exists in Unity 2017.2.0p4, whenever a file is not checked out yet this error will pop up. Once it's checked out it will not show again.
Your answer
![](https://koobas.hobune.stream/wayback/20220612152940im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I check if a key is down in scene view? 1 Answer
AudioClip generated by an external process and loaded into the editor has no samples 1 Answer
Custom Inspector: Accessing a reference to another MonoBehaviour? 1 Answer
A weird issue in Unity related to scripts and Editor. 1 Answer
Running scripts from editor 1 Answer