This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nikratio
Recipients nikratio
Date 2010-04-21.15:57:17
SpamBayes Score 7.615442e-09
Marked as misclassified No
Message-id <1271865439.77.0.481642755955.issue8487@psf.upfronthosting.co.za>
In-reply-to
Content
$ cat test.py
#!/usr/bin/env python
import os
import stat
dbfile = './testfile.test'
with open(dbfile, 'w') as fh:
    print('Opened file for writing')
os.unlink(dbfile)
os.mknod(dbfile, stat.S_IRUSR | stat.S_IWUSR | stat.S_IFREG)
print('Mknod\'ed file')

[cliff@ih ~]$ cd tmp              <-- nfs mounted on a 64bit Fedora box
[cliff@ih tmp]$ ~/tmp/test.py
Opened file for writing
Traceback (most recent call last):
  File "/home/cliff/tmp/test.py", line 9, in <module>
    os.mknod(dbfile, stat.S_IRUSR | stat.S_IWUSR | stat.S_IFREG)
OSError: [Errno 2] No such file or directory

[cliff@ih tmp]$ cd /tmp           <-- locally mounted on a HD
[cliff@ih tmp]$ ~/tmp/test.py
Opened file for writing
Mknod'ed file


I think the mknod() call really shouldn't fail if it tries to create an ordinary file that can be created with open() with problems.
History
Date User Action Args
2010-04-21 15:57:20nikratiosetrecipients: + nikratio
2010-04-21 15:57:19nikratiosetmessageid: <1271865439.77.0.481642755955.issue8487@psf.upfronthosting.co.za>
2010-04-21 15:57:18nikratiolinkissue8487 messages
2010-04-21 15:57:18nikratiocreate