Opening non-existent file returns different value when O_CREAT|O_DIRECTORY is used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all

On NFSv3, NFSv4 and xfs, opening non-existent file returns different value when 
O_CREAT|O_DIRECTORY is used, Is this the right behavior?


TEST LOG:
# cat open_tets.py 
#!/bin/python
import posix
fd = posix.open("/mnt/XXXX/file",posix.O_CREAT|posix.O_DIRECTORY, 0777)
print fd
posix.close(fd)

*xfs*
# ./open_test.py 
3                                 -- Create a file and return fd.
# ./open_test.py 
Traceback (most recent call last):
  File "./open_test.py", line 3, in <module>
    fd = posix.open("/mnt/xfs/file",posix.O_CREAT|posix.O_DIRECTORY, 0777)
OSError: [Errno 20] Not a directory: '/mnt/xfs/file'

*NFSv3*
# ./open_test.py 
3                                -- Create a file and return fd.
# ./open_test.py 
Traceback (most recent call last):
  File "./open_test.py", line 3, in <module>
    fd = posix.open("/mnt/nfsv3/file",posix.O_CREAT|posix.O_DIRECTORY, 0777)
OSError: [Errno 20] Not a directory: '/mnt/nfsv3/file'

*NFSv4.x*
# ./open_test.py 
Traceback (most recent call last):      -- return ENOENT err directly.
  File "./open_test.py", line 3, in <module>
    fd = posix.open("/mnt/nfsv4/file",posix.O_CREAT|posix.O_DIRECTORY, 0777)
OSError: [Errno 2] No such file or directory: '/mnt/nfsv4/file'

--


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux