473,387 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

NamedTemporaryFile and mode a+rwx

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 :
t=tempfile.NamedTemporaryFile(mode="a+rwx")
print t.name /tmp/tmp5wwa9K print t.mode a+rwx os.system("ls -l " + t.name) -rw------- 1 myLogin 0 Oct 3 15:30 /tmp/tmp5wwa9K os.system("stat " + t.name)

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

Oct 3 '05 #1
0 1300

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeremy Shovan | last post by:
What do I need to change to use the opendir() function when safe mode is in affect?? I have root access to the server and can make any changes neccessary except turn safe mode off Thanks in...
0
by: Pjotr Wedersteers | last post by:
(Suse 9.0, Apache 2.048, PHP 4.3.3 - all default install from SuSe ISO) I have in my wwwroot folder (/srv/www/htdocs) a folder called counters. I have embedded a page counter script into several...
3
by: vertigo | last post by:
Hello I have file acces mode as number for example: 755, and i want to change it to text for example: -rwx------ Is there any module/function for that ? Thanx
5
by: Lee Harr | last post by:
Is there any other reason to use a named tempfile other than to be able to open it again? I am trying to understand this section of the documentation regarding NamedTemporaryFile: """ Whether...
0
by: Jean-Francois Ortolo | last post by:
Hi all I need to know, whether or not any or all of those functions, are being permitted when safe mode is 'On', and the uid/gid of the current directory, is not the same as uid/gid of the...
2
by: Jason Lunz | last post by:
Is there a better way to do this? def QuietNamedTemporaryFile(**kwargs): ''' Return a NamedTemporaryFile that doesn't complain when its file has already been unlinked at __del__ time. ''' ...
6
by: Imbaud Pierre | last post by:
On suse 9.3, tempfile.NamedTemporaryFile() doesnt work as expected. (I found a permanent workaround, so I dont ask for help) I expected to write to a file, and access it thru a shell command. This...
20
by: cscorley | last post by:
For some reason, I cannot use fopen() on the file in write mode. The file "time" is in the same directory as the .php file, with permissions set to 0766. PHP Version 5.2.5 Apache/2.2.8 code...
1
by: rparimi | last post by:
Hello pythoners, When I create temporary file using the tempfile module, and forkI) later on in my program, I always see errors when the program exits. Is this because the child process deletes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.