Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #46584
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-05-31 02:27 -0700 |
| References | <0e688580-c0fb-4caf-8fb1-f622b2c7bcb5@googlegroups.com> |
| Message-ID | <4fc3af47-2dc4-4de1-9479-53741215c3a2@googlegroups.com> (permalink) |
| Subject | Re: Create a file in /etc/ as a non-root user |
| From | Luca Cerone <luca.cerone@gmail.com> |
> fd = open('/etc/file','w')
>
> fd.write('jpdas')
>
> fd.close()
>
>
Hi Bibhu, that is not a Python problem, but a permission one.
You should configure the permissions so that you have write access to the folder.
However unless you know what you are doing it is discouraged to save your
file in the /etc/ folder.
I don't know if on Mac the commands are the same, but in Unix systems (that I guess Mac is) you can manage permissions with chmod.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Create a file in /etc/ as a non-root user BIBHU DAS <b13das91@gmail.com> - 2013-05-31 02:12 -0700
Re: Create a file in /etc/ as a non-root user Luca Cerone <luca.cerone@gmail.com> - 2013-05-31 02:27 -0700
Re: Create a file in /etc/ as a non-root user Dave Angel <davea@davea.name> - 2013-05-31 07:11 -0400
Re: Create a file in /etc/ as a non-root user Alister <alister.ware@ntlworld.com> - 2013-05-31 14:02 +0000
Re: Create a file in /etc/ as a non-root user Chris Angelico <rosuav@gmail.com> - 2013-06-01 00:42 +1000
Re: Create a file in /etc/ as a non-root user rusi <rustompmody@gmail.com> - 2013-05-31 21:39 -0700
Re: Create a file in /etc/ as a non-root user Nobody <nobody@nowhere.com> - 2013-06-01 01:20 +0100
Re: Create a file in /etc/ as a non-root user Tim Chase <python.list@tim.thechases.com> - 2013-05-31 19:49 -0500
Re: Create a file in /etc/ as a non-root user Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-01 21:19 +0000
Re: Create a file in /etc/ as a non-root user rusi <rustompmody@gmail.com> - 2013-06-01 19:51 -0700
csiph-web