Error when saving: can't open file [file directory]

Hi. I’ve been using KiCad for around a year now. I’m overall happy with all the features it presents. However I keep having this issue where KiCad keeps popping up an error window saying “can’t open file [file directory]. Access denied”. It happens both everytime KiCad autosaves and also when I manually hit the save button.

I understand this issue is more related to Windows permissions than KiCad itself, as well as the fact that it’s not really that important since the changes get saved correctly despite of the error. I’m also aware that it could be easily solved by moving the project files somewhere else like an external hard disk, but I’d like to keep my files on my local disk (and thus finally learn how to deal with permissions once and for all!) and get rid of these errors which are starting to get me on my neves after a year using KiCad haha.

Any help will be greatly appreciated.

Cheers :slight_smile:

Check that the length of your kicad project directory path is not reaching 255 characters. The autosave will exceed that and struggle on windows unless you turn on long path mode in Windows.

Hi marekr,

Using a char count tool I’ve got to know the directory path for the project is 96 characters long.

Is the directory on a network share?

No, it’s under My Documents on my local disk and I’m not sharing that folder

Did you ever accidentally run kicad as administrator, save the files and then unknowingly switch back to normal use?

The thing to check is the windows folder permissions and ensure the folder the project is in is owned by you

Navigating through the Properties of the folder I’ve found this field (“Propietario” means owner in spanish:
imagen
being Enf my user account. That being said,

I might have done that in the past for this specific project. Does that affect somehow?

Running as administrator means any files that get created will get admin ownership. A normal user account will then not be able to access the files.

If this is the case you will need to edit the permissions of the files and give your account (enf) read/write access to them.

Correct me if I’m wrong since as I mentioned above I’ve never dealt with Windows permissions before, but this is the menu where you edit them, right? If that’s is so, the image linked shows the permissions for my user (Enf) for the KiCad project. In my eyes I seem to have access to all of them. They are also the same for the Board and the Schematic associated with the project.

It depends where the error is originating from, when KiCad is run as an Administrator many files could be modified (not only the project files), including the ones in %APPDATA%\kicad\6.0.

If your project is in a stable state, you can try deleting (or moving it somewhere else) the backup directory and see if that fixes your problem, if the error message tells you that the files with problems are somewhere in C:\Users\ your_user \AppData\Roaming\kicad\6.0\ you could delete it too (after carefully backing up your stuff of course)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.