Home » Category » Python

Python: NamedTemporaryFile and mode a+rwx

200| Tue, 06 May 2008 20:00:00 GMT| christophe_delarue_gmail| Comments (0)
Hi,

I'd like to create a temporaty shell script. Therefore I use tempfile
with NamedTemporaryFile. The problem is that the _mkstemp_inner create
the file using 06000 code. Then the fdopen is called, but the stat of
the file does not change to executable.

Why the fdopen does not modify the mode of the file ?

Without the executable flag, this could not be understood as an
executable file.

Thanks.

the trace :

/tmp/tmp5wwa9K
a+rwx
-rw-- 1 myLogin 0 Oct 3 15:30 /tmp/tmp5wwa9K
File: `/tmp/tmp5wwa9K'
Size: 0 Blocks: 0 IO Block: 8192 regular empty
file
Device: 2h/2d Inode: 8593614 Links: 1
Access: (0600/-rw--) Uid: (10373/ numerix) Gid: ( 1102/
rms)
Access: 2005-10-03 15:30:38.000000000 +0200
Modify: 2005-10-03 15:30:38.000000000 +0200
Change: 2005-10-03 15:30:38.000000000 +0200

Keywords & Tags: namedtemporaryfile, mode, a+rwx, python

URL: http://programming.itags.org/python/53094/
 
«« Prev - Next »» 0 helpful answers below.

Python Hot Answers

Python New questions

Python Related Categories