Author Topic: CodeBlocks having trouble saving to Dropbox directory  (Read 1248 times)

Offline rapsadoodle

  • Single posting newcomer
  • *
  • Posts: 3
CodeBlocks having trouble saving to Dropbox directory
« on: January 20, 2018, 10:45:34 am »
Whenever we create a new project with CodeBlocks and try to save it anywhere in the Dropbox hierarchy we get this complaint:

"Warning  Couldn't save project  (Maybe the file was write-protected?)"

We're running CodeBlocks 17.12 and Dropbox desktop v41.4.80.

I haven't seen any other programs with trouble saving to this Dropbox directory.

It only gives the warning once and it does appear to have actually saved the project.

It only happens while the Dropbox desktop application is running.

Have fun,

Your friend rapsadoodle

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2096
Re: CodeBlocks having trouble saving to Dropbox directory
« Reply #1 on: January 20, 2018, 10:25:53 pm »
codeblocks uses this strategy to save a file:
1) create a temp file and save the content
2) copy the temp file over the actual file
3) remove the temp file

This is the most save strategy to save files. Dropbox can make a lot conflicts with this strategy:
in step 2) block the actual file from the copy, because it is indexing
in step 3) block the temp file from deleting, because of indexing
i am not sure, but i think there is a setting to configure the save strategy somewhere in the settings. you can try to modify this.
But i don't see any way to fix this beside stepping away from the current good saving strategy... Does dropbox has a ignore file? You can try to add the temp file to the ignore file list....

Offline rapsadoodle

  • Single posting newcomer
  • *
  • Posts: 3
Re: CodeBlocks having trouble saving to Dropbox directory
« Reply #2 on: February 04, 2018, 12:47:58 pm »
Hi BlueHazzard,

Sounds like you've identified the cause of the problem. I'd posted a similar query in a Dropbox forum where there were some good questions posed to me, so I copied most of your enlightening answer there:

https://www.dropboxforum.com/t5/Installation-and-desktop-app/CodeBlocks-has-trouble-saving-a-new-project-in-the-Dropbox/m-p/261517#M48591

I did look in the CodeBlocks settings to modify the save strategy, but I couldn't find anything that looked like it would make a difference.

Dropbox does not have such an ignore file, that I could find, but perhaps my response post there will bring further enlightenment.

Thanks for you thoughts.





Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2096
Re: CodeBlocks having trouble saving to Dropbox directory
« Reply #3 on: February 04, 2018, 02:17:35 pm »
Yes the setting i was thinking of is only for auto save, and not for the normal save process....

i am afraid, there is no easy solution for this... At least not from codeblocks part...

Offline rapsadoodle

  • Single posting newcomer
  • *
  • Posts: 3
Re: CodeBlocks having trouble saving to Dropbox directory
« Reply #4 on: February 09, 2018, 07:10:16 pm »
Well, it's a pretty minor problem, and I think I got great help here with the identification of the problem.

Thanks and have fun.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2096
Re: CodeBlocks having trouble saving to Dropbox directory
« Reply #5 on: February 09, 2018, 10:46:26 pm »
i find it interesting that the file gets saved correctly....

Offline iapetus

  • Single posting newcomer
  • *
  • Posts: 1
Re: CodeBlocks having trouble saving to Dropbox directory
« Reply #6 on: March 18, 2018, 04:08:45 pm »
Hello!

Also I had the same problem, I thought is the Dropbox but it isn't. The problem is Code Blocks, it has some kind of length limit of the project name, I made some tests and the limit is 27 characters.