File System - Representing Symbolic Links|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
File System - Representing Symbolic Links
Avatar
okapi
Member
Members
Forum Posts: 5
Member Since:
07/18/2020
sp_UserOfflineSmall Offline
1
07/18/2020 - 15:36
sp_Permalink sp_Print

Hello,

I have some questions about file system representation in a server using FileType and FileDirectoryType according to Part 5 Annex C and symbolic links (on a Linux system) as I could not yet find some more details in the specification.

There are several options how a symbolic link to an element could be represented, two examples are below:

1: Treat a symbolic link (and all elements below in case of a directory) like a normal individual node in the address space. So it is not visible that the node represents a linked element. Every element that can be reached from the link gets a new node instance.

But this leads to the next questions like how to handle the OpenCount of a file: Should the OpenCount be synchronized between all FileType instances representing the same file?

Another topic is related to the possibility of creating circles: Every file system element (file or directory) is added with an Organized reference below an instance of FileDirectoryType. As far as I know circles created with hierarchical references are forbidden within a servers address space. In general on a file system it is possible to create circles using symbolic links. With this approach it would lead to an endless deep structure in the address space. (Needs presumably be detected by the server implementation and stopped somehow.)

2: As hierarchical references can not be used in all cases: Use another not hierarchical reference type to connect the parent node/directory of the symbolic link and the (already existing) node representing the destination of the link. This would solve the possible issues of several nodes representing one file or hierarchical circles. But as it is a custom solution it can presumably not be handled by all client implementations accordingly.

I had a look at the file access facet related test cases, but it seems that they are not formulated yet. Have topics like this maybe been addressed already somewhere else?

It is possible to create a custom solution for file system related topics like symbolic links, but I think that it would be good to have some best practices how to handle them (even if it can or will not be specified). This would presumably simplify client implementation as they do not need to handle several different solutions from different servers. Are there maybe plans to create such hints for implementing file system access via OPC UA?

Thank you.

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
07/18/2020 - 16:24
sp_Permalink sp_Print

Use references.

The same FileType Object can be the target of Organizes references from many FileDirectoryType Objects.

Any symbolic link would be replaced with a reference to the real FileType Object.

This eliminates any questions about OpenCount etc. because there is only one Node that is accessible via multiple paths.

Avatar
okapi
Member
Members
Forum Posts: 5
Member Since:
07/18/2020
sp_UserOfflineSmall Offline
3
07/20/2020 - 14:07
sp_Permalink sp_Print

Thanks for the quick reply.

In case a file is the target of the symbolic link, your solution is the best choice. I agree. The hierarchical Organizes reference can be used like for every normal file located in the directory. (And it solves several problems when multiple nodes would represent one file.)

But there is still the hierarchical circle aspect when the target of the symbolic link is a directory: It may not happen very often but it is possible to create circles in the file system using symbolic links to directories. If Organizes is also used to refer to the target directory of the symbolic link, it could result in hierarchical circles in the address space. That was the reason why I wrote about using a not hierarchical reference.

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
07/20/2020 - 18:00
sp_Permalink sp_Print

Organizes is a "looping" hierarchical reference type which means creating circles is permissible.

Sub-types of HasChild are 'non-looping'.

https://reference.opcfoundatio.....Part3/7.1/

Avatar
okapi
Member
Members
Forum Posts: 5
Member Since:
07/18/2020
sp_UserOfflineSmall Offline
5
07/20/2020 - 21:51
sp_Permalink sp_Print

So my problem representing symbolic links with Organizes references was based on the misunderstanding that circles with all kinds of hierarchical references are forbidden. Thank you very much for clarifying this!

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 20
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1347
Posts: 4567