> 2. > Creating a hardlink to a file in ram: and then editing the file > (not the link) turns the hardlink into a file. (odd but perhaps normal?)
Yes it does, hardlinks do wierd things on different filesystems, that is, if they actually are supported at all. Use SOFTLINKS and that sort of wierdness won't happen.
> 3. > Hardlinks hand the full path in ExamineData.Link (including device name) > Soflinks does not have the device name in ExamineData.Link
It's going to be what was specified when creating the link, and can often be current dir relative, but then again, refer to (2)
Check your code against the examples in the autodoc, you may be doing something wrong, or missing a particular data type specifier flag, or evaluating out of order. Always check EXD_IS_LINK() first.
2. Creating a hardlink to a file in ram: and then editing the file (not the link) turns the hardlink into a file. (odd but perhaps normal?)
With FFS and ram-handler: Yes. They don't have usual hard links but a strange implementation which only exists on AmigaOS, one of the links has to be a file and if you delete the link which is currently the file one of the other links has to be converted into a file instead.
"Not here, it is reported correctly as a SOFTLINK by ExamineDir() 0x0100 = FSOF_LINK(0x0100) | FSO_TYPE_SOFTLINK (0x00)"
That's odd, i doesn't do that here. (yes I check link first, then type). It works for hard links but not soft links. For soft links I now have a workaround that does ExamineObjectTags() on each entry that reports as a soft link when listing a directory. (tested on SFS and RAM with the same result, 4.1 non beta)
"Yes it does, hardlinks do wierd things on different filesystems, that is, if they actually are supported at all. Use SOFTLINKS and that sort of wierdness won't happen."
Hmm not so easy to support them in a file manager then since the outcome of accessing them can be a bit random.
"It's going to be what was specified when creating the link, "
Is there a way to resolve the complete path with device name (without writing my own parser that is)? In my file manager I want to go to the actual path when clicking a directory link since using just the current path + linkname can results in errors such as "too many levels" when trying to create a file/directory or just opening a file in notepad.
"That's odd, i doesn't do that here. (yes I check link first, then type). It works for hard links but not soft links. For soft links I now have a workaround that does ExamineObjectTags() on each entry that reports as a soft link when listing a directory."
Huh ? - That's exactly how you resolve the link. When you ExamineObject() a softlink you get the object it is linked to, it's supposed to work like that. You need to see how to resolve links, consult the autodoc for ExamineDir() - NOTES section.
What filesystem are you using there ?, Have you tried other filesystem partitions ?, What hex VALUE is in exdata->Type for that entry from ExamineDir() ?
I'll send you a test program privately.... Send me a blank email so I can get your address if you want it.
"Huh ? - That's exactly how you resolve the link. When you ExamineObject() a softlink you get the object it is linked to, it's supposed to work like that. You need to see how to resolve links, consult the autodoc for ExamineDir() - NOTES section."
Ahh, nice that I unintentionally ended up doing what I was supposed to do then ;)
"What filesystem are you using there ?," "Have you tried other filesystem partitions ?," Ram and sfs
What hex VALUE is in exdata->Type for that entry from ExamineDir() ?
On JXFS if you try to create a hard link, it just creates a copy of the file instead.
No, it creates a hard link. Just a real one, like for example on Unix, not the weird FFS hard links, and most AmigaOS programs can't identify them as hard links (ExamineData UseCount is > 1 and all directory entries have the same ObjectID).
Hmm, well there's something wrong as if I create a file "test1" makelink test2 test1 and then edit test2, the contents of test1 don't change as they should.
Hmm, well there's something wrong as if I create a file "test1" makelink test2 test1 and then edit test2, the contents of test1 don't change as they should.
If you change test2, for example using "echo >>test2 foobar" in a shell, the contents of both changes. Most editors don't change the file, they delete the old one and create a new one instead and if that's done test1 and test2 are of course different files, for example "echo >test2 foobar" in a shell does that as well.