Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

How to make Box drive have the files prepared for access when I need it?

+0
−0

I have Box drive on Windows. I use it as a regular folder on the computer. I can store images there. When I store a small number of images (on the order of a couple hundreds) and I do not wait long to access them (on the order of a month), I do not have problems accessing them. When I store a large number of images (on the order of thousands), I have the following problems:

  1. reading them in Python with opencv function cv2.imread() always gives me a reading error after some image (cannot open/read file) (i.e., it reads first several images, but then it starts giving me the error),
  2. copying the entire images folder from the Box drive to my hard drive using Windows' copy command may or may not result in a copying error at some image (i.e., it starts copying, it copies first several images, then it gives me the error).

Note, once I have copied all the images to my hard drive, the same Python code for images reading works without a problem (it also works way faster, but that is a whole other story). This has been happening for a couple of years, on different Windows updates, conda updates, Python updates, opencv updates and spanning at least 10 different codes I wrote.

I think it is a general problem related to the way Box drive handles files. If I am correct, I am wondering if anybody can explain to me, please, why Box drive does that and how to mitigate that.


I do not know what code or error messages to provide here. I am interested in a general explanation and solution. However, if you need something like that to give me the answer, please, guide me what exactly I should provide.


Per Alexei's requirement, I am posting the error I receive when I am trying to read images from a Box folder with opencv-python (even though I am sure it's pointless, the problem is not in opencv as I discussed above, the problem in Box drive):

[ WARN:0@6.190] global C:\b\abs_d8ltn27ay8\croot\opencv-suite_1676452046667\work\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('21.06.24 PIV with shadowgraphy images\BackgroundImages\ShadowgraphyImages.7udrx7mu.000004-1196.2040.a.jpg'): can't open/read file: check file path/integrity

As you may notice, the name of the image file contains the number 000004. This number means that this is the 5th pair of images in the folder or the 9th image. I.e., opencv read the first 8 images and then something happened preventing it from reading the 9th one.

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Error codes/mesages (1 comment)

1 answer

+0
−0

A probable solution.

I suspect, I have identified the culprit. It turns out that Box drive limits the number of characters the full file path can have. Note, not usual limit of 256 characters in the file name, but 256 characters in the entire file path (and 100 characters in the folder path).

I checked, all my file paths are more than 256 characters. That can cause all sorts of weird behaviors and, probably, the ones that I described in my post.

For reference, see the following thread titled "File name length limits" on Box support website: https://support.box.com/hc/en-us/community/posts/360049225933-File-name-length-limits

Also for reference, I uncovered this problem when I tried to save files to Box drive that have really long file paths and got an error saying that the files could not be saved. And then I realized, it could be the reason I can't read the files from Box drive.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »