Hi,
I ran into the following problem: the directories and files created locally cannot be immediately accessed via a network path.

Example:
I am working on the host "cloud". Directory "/var" is exported and is also accessible (from the same host or some other hosts) as "/net/cloud/var".
Directory /var has a sub-directory "tmp" that has write permissions set.
I am running a self made program called "show_files" that checks every 3 seconds whether the "/net/cloud/var/tmp/hi" file exists. Internally it calls the function
access("/net/cloud/var/hi", F_OK).

Between the time I do "touch /var/tmp/hi" and the time  the "show_files" programs reports that the file is there there is a 30 second gap.

I also created a program that first creates the file locally and then tries to access it via a global path:
Here is its sketch:
fd = open("/var/tmp/hi" O_WRONLY|O_CREAT|O_EXCL, 0600);  /* creating the file using local path /var/tmp/hi */
close(fd);
if (access(/net/cloud/var/tmp/hi", F_OK) == 0) /* checking if the file exists using the global path /net/cloud/var/tmp/hi */
        printf("The file is here");
else
        printf("The file is not here");

When the program is running by itself, it always succeeds. However when another process that tries to access the file /net/cloud/var/tmp/hi using the global path (e.g. the show_files program described above), runs at the same time, the access check fails.

Other UNIX flavors do not have this problem.

Please tell me if there is something I can change in the configuration to get rid of this? Or maybe there is a patch for linux 8.0 that would allow me to get rid of it?
Thanks
Nick

[EMAIL PROTECTED]

Reply via email to