Unsolved
This post is more than 5 years old
5 Posts
0
870
September 6th, 2018 16:00
Can I rely on the LIN in a changelist to identify a 'mv' operation?
When I mv a file or a directory, the corresponding changelist (in REST API) shows two related entries. For example, if I do 'mv /dir_to_rename /another_dir/dir_after_rename', the changelist shows:
{
"atime", "mtime" and "ctime" are omitted
"id" : "2305843102626460960",
"path" : "/dir_to_rename",
"size" : 69,
"type" : "directory"
}
and
{
"atime", "mtime" and "ctime" are omitted
"id" : "93412767008",
"path" : "/another_dir/dir_after_rename",
"size" : 69,
"type" : "directory"
}
I found out that the old LIN (id) is 2305843102626460960=0x20000015BFD5B520, and the new LIN (id) is 93412767008=0x00000015BFD5B520.
It looks like old_LIN = new_LIN | 0x2000000000000000, that is, the 61th bit of a LIN means a deletion and if there is another LIN with 61th bit set to 0 and everything else the same, then it's a 'mv' operation. I also saw the 61th bit set for regular 'rm' operations.
Obviously this conclusion is from my reverse engineering. So my question is, can I rely on this behavior to identify 'mv' operations?
A followup question would be, how should I utilize the LINs in a changelist? Does it have any relation with the file/dir's inode? Are there any guidelines on the LINs inside changelist?
Thanks a lot in advance.
events found

