Feature Request Idea: --original should give inode number

I was going to add this to the github but as per the template, I am discussing it here first.

The documentation for lsjson says that --original will "Show the ID of the underlying Object.". It seems to me that on *nix based platforms using the local file system, that would be the inode number. Would it be possible to have that be provided? Is there a windows equivalent? (I don't use windows)

Thanks

An inode is something related to a local file system and does not exist on storage so there isn't anything to map to as it's cloud storage not a local file system.

You'd be basically asking rclone to make up inode numbers.

I’m not. On other file systems it will show the original id like it says it does now with that flag. I’m asking the feature that exists for other systems to be implemented for local.

hi,
how would make sure of this feature, what is the use-case?

My main use case is for tracking files outside of rclone’s move tracking. But beyond that, it just feels more complete of an implementation of local file systems. Obviously, there are always minor differences between storages but why miss out on an opportunity to be closer to parity?

can you give a real world example of why this is needed?

I don't see why you'd use rclone on a local file system as I'd use a normal command on a local file system to get the inode if I needed the inode. I wouldn't use rclone at all.

rclone is my tool for any cloud based storage.

I think this would be possible. Reading the inode number isn't particularly cross platform though so this would only work on unix-like platforms, unless Windows has some equivalent.

AFAIK the only way to get the inode is from a stat call so in order for this to be efficient yo'd want to cache the inode number in the local Object, or live with ID() calling stat each time.

To be truly unique you'd want to keep st_dev as well as st_ino as inode numbers can be re-used across file systems.

I'll talk you through this if you want to have a go at it?

First, let me say, I think your attitude of including and helping people is amazing! It's really cool.

But, I know absolutely no Golang. I do all of my coding in Python and, while I want to branch out soon, coding is not really my job; just the tool I use to do it. So it's been hard to find the time to learn.

Do you think it is something a complete novice (e.g. never even wrote "hello world") could do? What level of proficiency do you think I would need to try to implement this? It could be a good excuse to learn Golang but I also can't devote a ton of time.

:slight_smile:

If you are an experienced programmer it is pretty easy to get up to speed in Go. I recommend the go tour as a good starting point. Conceptually Go is a pretty simple language (think C rather than C++/rust) and that is the way google designed it so that it has a short onramp.

Take a look at the code in the local backend and see if it sorta makes sense, if so then I'd say go for it!

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