Files not Found unless I restart several times

I am loading in some files stored on a different drive on my computer.
Sometimes when I start my application it loads them with no problem. However sometimes I have to restart my application several time for it to find these files. Everything remains the same but it finds the files when I try several times.

Any thoughts on why this might be happening?
Perhaps it would help if I put my application on the same drive as the image files?
Perhaps I will have it try several times within the application itself, but it would good to have a understanding of why this might be happening.

This problem has gotten worse and I don’t know why. I get the program compiling and finding the files on the external drives after many attempts of cleaning, rebuilding, and running. Eventually without me changing the code it finds the files and then it will compile from there on out. But if I reboot the machine I am back to square one of recompiling and hoping for the best. :rage:

The problem occurs every time I try to read a file from my raid1 6 tb drives (similar to this model).

So the problem occurs when I load from this file path (Storage is the name of the drive):

ofLoadImage("/media/caroline/Storage/imgFile.jpg");

But not when I load from say the Desktop:

ofLoadImage("/home/caroline/Desktop/imgFile.jpg");

I’ve been using this code for a month + with this setup and I have only been getting this error in the past two days. I moved the equipment and we have a different power supply (a ups - which occasionally beeps in a very worrisome way) and I have been doing rather reckless things with popping threads. Are those possible confounds?

As it currently stands I am afraid to restart this computer because I don’t know what factors are controlling whether I can access these external files from OF. I cannot put them on the computer itself because there isn’t enough space.

Any illumination on this issue would be ever so appreciated :sweat_smile:

how are you mounting the external drive? take a look at /etc/fstab configuration to know how to reliably mount it while the computer boots and before the desktop starts. the wikipedia page looks like a good resource: https://en.wikipedia.org/wiki/Fstab

you can also check with which options it’s mounted using mount on a terminal and from there get the info you need in fstab

as a very hacky solution you could also check for the file in a while loop and continue as soon as it pops up.

but having a proper fstab configuration that waits for all the files is probably a better idea :wink:

We looked into Fstab over here, but the problem has stopped occurring! We have figured it out and it was related to that worrisome beeping UPS power supply I mentioned in my second post.

We had three 70" monitors and a hefty linux box all hooked up to the one UPS. When the application was run the computer drew more power than the UPS could provide and would stop powering the two drives. As a result we couldn’t access those files.

Now the monitors are on their own power strip and the computer is the only thing on the UPS and there is no more terrible beeping and no more trouble accessing those files.

Thank you for your help! :heart: I was really stumped on that one for a bit.