[wfx] Saving arbitrary data for each entry

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
philk
Junior Member
Junior Member
Posts: 11
Joined: 2006-10-01, 16:15 UTC

[wfx] Saving arbitrary data for each entry

Post by *philk »

Hello, fellow developers,

In the filesystem I am developing a plugin for, there can be multiple "files" with the same name. When it comes to operations like "delete" I have no means to decide which file to delete by just parsing the remote path handed in by TC. So when creating the filelist I would like to include a special value for each entry returned by FsFindFirst and FsFindNext. So far I do not see that this is possible.

Its also not possible to encode this information in some way into the filename itself without cluttering up the filename display. I tried to encode it into the filename in a hidden way after the first "0" terminator of the C-string like this:
<filename>\0<info>\0\0
But I never get this string back from TC, of course.

Does anybody of you have an idea how to save arbitrary data for each file entry in such plugin?

Thanks in advance,
Phil
The Dude Abides.
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

I think what you want to do is not possible. How do you have duplciate names!!

I don't know your plugin, but how do i know i am selecting the right file if there are duplicate filenames?
______________________
David Jorge
Personal License #117854
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

U can do this:

Append ALT 0160 (pseudospace) to the end of eatch duplicate name. Eatch next name should have one pseudospace more.

So you are basicly making different names that appear to be the same to the user.

If you have 4 same enteries named A, you will have:

Ap
App
Appp
Apppp

that will all look the same : A
Habemus majkam!
philk
Junior Member
Junior Member
Posts: 11
Joined: 2006-10-01, 16:15 UTC

Post by *philk »

@majkinetor: I will try this one :)
@djorge: You know which file by the date attribute and when you quickview the file. Unfortunatly the underlaying system allows duplicate names. Each entry has a unique number though, but I do not like to include this into the displayed name.
The Dude Abides.
User avatar
comrade
Junior Member
Junior Member
Posts: 12
Joined: 2014-10-26, 03:34 UTC
Location: Russian Federation

Post by *comrade »

philk, I have run into the same problem. It would be great if the host provided a way to associate a custom context (a pointer-sized quantity would do) for each file.

I have worked around this by encoding my custom identifier in the returned file name. This makes the filename long and contain internal data, which is not very pretty. I've added a new custom column which is the real name, and can be duplicated.
Post Reply