Which file share mode is used by a directory access server, when reading the contents of files? And is the Read Only clause in the create statement influencing the used mode?

asked 26 May '14, 06:08

Martin's gravatar image

accept rate: 14%

Another important missing detail for that older question: Where is the real documentation on directory access servers?...

(26 May '14, 06:11) Volker Barth

I've scanned the low-level Directory Access Server code and here is what I see:

  • Directories are opened with plain-ol' "opendir" function call.
  • When file contents are being read, the file is opened with open( ..., O_RDONLY | O_BINARY, O_RDONLY )
  • When a file is being created or contents written, the file is opened with variations of open( ..., O_WRONLY | O_BINARY, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ). O_CREAT is added when the file is being created and O_TRUNC is also added if the existing file contents need to be removed.
  • Directories are created with mkdir( ..., S_IRWXU | S_IRWXG | S_IRWXO )

The exact behaviour may vary depending on how the platform handles the open flags.

Note that the READ ONLY state of the proxy table only influences the high-level code within the database server: if a table is marked as read only then the server denies any attempt to write/update contents to the table. It does not affect the open flags that are used.

Disclaimer: The above is what SQLA 16 does currently (as of today when I looked at the code). Other versions may be slightly different (although I doubt it), and future versions may also differ.


permanent link

answered 26 May '14, 12:10

Mark%20Culp's gravatar image

Mark Culp
accept rate: 41%

edited 26 May '14, 13:37

Thanks for checking ....

(27 May '14, 02:31) Martin
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 26 May '14, 06:08

question was seen: 1,311 times

last updated: 27 May '14, 02:31