• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Stop struggling with Lightroom! There's no need to spend hours hunting for the answers to your Lightroom Classic questions. All the information you need is in Adobe Lightroom Classic - The Missing FAQ!

    To help you get started, there's a series of easy tutorials to guide you through a simple workflow. As you grow in confidence, the book switches to a conversational FAQ format, so you can quickly find answers to advanced questions. And better still, the eBooks are updated for every release, so it's always up to date.
  • Dark mode now has a single preference for the whole site! It's a simple toggle switch in the bottom right-hand corner of any page. As it uses a cookie to store your preference, you may need to dismiss the cookie banner before you can see it. Any problems, please let us know!

Semi OT Question re File path on Windows

Status
Not open for further replies.

OogieM

Active Member
Premium Classic Member
Joined
May 28, 2012
Messages
152
Location
Colorado
Lightroom Experience
Intermediate
Lightroom Version
Lightroom Version Number
Lightroom Classic version: 10.1.1 [ 202101041610-8c69aa4e ]
Operating System
  1. macOS 10.15 Catalina
I've got a rather off the wall question. I'm actually working on an SQLite database design where I have to reference external files. I know Lightroom uses an SQLite database for the catalog and I've looked at how it stores the file path and folder names on a copy of my catalog on the Mac.

My question is for any Windows user comfortable with looking at the catalog directly with a database browser tool (do this on a COPY, not your real catalog) and if you could look at the AgLibraryRootFolder table and tell me whan an entry looks like in the field absolutePath and also take a look at the AgLibraryFolder table and tell me what an entry in the pathFromRoot field looks like. I'm particularly interested in whether the separator charcters follow Unix or Windows conventions.

Related is if anyone knows if you move a LR catalog form one operating system to another, where the file paths use different separator characters, is the database itself modified or converted or is a second set of entries put in? Does this happen each time you move the catalog? Does anyone ever move LR catalogs back and forth across windows and Mac systems regularly?

In my own database I'm trying to decide how best to implement the ability for the same database file to operate the same on Mac, Windows and Linux systems yet I need to store paths or references to external files.

In my case the external files are genomic data, SNPs or DNA sequences in a variety of formats for individual sheep. I don't want to actually include that data in my database but my users will need to know where it is to run their own analyses on it and my database needs to let the user know if a particular sheep has had their DNA analyzed and by what method and where the data are.

I'm the only programmer on the project so I'm trying to look at how other similar applications implement the function.

I realize this is not a LR question but since I don't have a Windows machine with LR to look at the database it’s the only place I could think of to ask.
 
I checked in my catalog on Windows 10, the separator used is the slash ("/"), in both AgLibraryRootFolder and AgLibraryFolder.
 
Here is what I know about the path fields in the Lightroom Catalog file:
  • There are two fields: absolutePath and relative path.
  • absolutePath contains a Drive letter (e.g. "C:\) when created in a Windows environment. Of course this does not exist in a Mac environment. This is why image locations are not resolvable if the file is ported from one OS to the other.
  • relative Path is only resolvable in Windows when the catalog file and the images are located on the same windows volume. If both are located on the same volume, then Lightroom in MacOS will resolve the path and correct the absolute path containing a drive letter.
  • I have not looked at the SQLite data base in some time but I think the absolutePath and the relativePath are stored for the image with a folder container name for the file and each folder lists the index to the next parent. IOW, AgLibraryRootFolder table contains an entry for each folder, its index value and the index value of the next parent. If you keep Bothe toys database file and the files that it references on the same volume and use relativePath, the your database entry will always be resolvable on POSIX compliant filesystems and NTFS.
In Lightroom the default location for the images are relative to the location of the catalog. This makes it easy to port the catalog and images file form Windows OS to MacOS and back because the relativePath field is resolvable. When the Windows environment is used, and the images are located on a different volume, only the absolutePath is valid and the relative path is null. MacOS does not understand the Drive letter in the absolutePath and can not resolve the path of the images. So if you can make the path of your data file relative to the path of the database file and use a relativePath in the data base, then your data base will remain valid for any OS that you use.
 
absolutePath contains a Drive letter (e.g. "C:\) when created in a Windows environment.
Only if the partition is accessed via a letter. If the partition is mounted in a folder, then it's the mount path (via the folder) that is stored.
 
So if you can make the path of your data file relative to the path of the database file and use a relativePath in the data base, then your data base will remain valid for any OS that you use.
Thank you! That is a very clear explanation for how it works and will allow me to implement it that way in my own system. It makes perfect sense now that you type it but since I've never worked in Windows I get flumoxed by the file and path naming differences.
 
It's very usefull if your store your database and photos on an external drive to use it with different computers. On windows, this avoid to have to deal with the drive letter from one computer to the other. Opening the catalog is enough to have LR find the files, whatever the letter the extrenal drive is mounted on.
 
Thank you! That is a very clear explanation for how it works and will allow me to implement it that way in my own system. It makes perfect sense now that you type it but since I've never worked in Windows I get flumoxed by the file and path naming differences.

As I outlined the process is how I would tackle your project. I avoid Windows as much as possible because it is not POSIX compliant

If I needed to implement such an app on cross platforms, I would keep the database and all data files on a portable volume that uses an exFAT/FAT32 filesystem.


Sent from my iPad using Tapatalk
 
Status
Not open for further replies.
Back
Top