You are not logged in.

#1 2023-08-09 09:44:49

avidseeker
Member
Registered: 2022-09-06
Posts: 58
Website

Linking files to "belong" to other files

There was an old feature in Windows that somehow bind files to each other. Try this on Windows: Ctrl+S to save this page as HTML, then rename the HTML file, you'll get a dialog like:

If you rename this file, it will no longer blong to the folder 'Linux - Wikipedia_files'

https://i.imgur.com/lSNh2Cn.png

And when the html file is moved to another location, its asset directory is also moved.

The use cases for this are plenty. The most common one is when you have a lot of markdown files with corresponding asset directories (think of static websites generators).

When I switched to Linux, I just accepted this might require a lot of work to get implemented. But I was just looking into Extended attributes and thought it might be way easier. Of course, every file manager (and perhaps CLI utilities) might need to be reworked to respect the attached xattr, but it still simplifies the job. What are your thoughts?


moderator edit -- replaced oversized image with link.
Pasting pictures and code

Last edited by 2ManyDogs (2023-08-09 11:04:29)

Offline

#2 2023-08-09 10:30:49

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,045
Website

Re: Linking files to "belong" to other files

I'd argue that this has no place in low-level tools like mv.
In a file manager, it might be useful in very few cases, but probably not worth the effort.
When I am coding I use the refactoring functions of my IDE to rename files in order to automatically adjust potential imports.
This is the only place I can think of where I ever needed such a functionality and actually used it.


macro_rules! yolo { { $($tokens:tt)* } => { unsafe { $($tokens)* } }; }

Offline

#3 2023-09-03 07:52:10

avidseeker
Member
Registered: 2022-09-06
Posts: 58
Website

Re: Linking files to "belong" to other files

Looks like Windows is using this interesting filesystem feature to achieve that: https://en.wikipedia.org/wiki/Fork_(file_system)

Offline

Board footer

Powered by FluxBB