468,168 Members | 1,514 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,168 developers. It's quick & easy.

file handling in a server (.py) file using xmlrpc

uwb

I've got a call to glob in a .py file sitting in an apache cgi-bin directory
which refuses to work while the exact same code works from a python console
session.

I'm guessing that in order to read or write files from any sort of a script
file sitting in the cgi-bin directory on a server, something has to be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.

Jul 21 '05 #1
4 1482
uwb wrote:
I've got a call to glob in a .py file sitting in an apache cgi-bin directory
which refuses to work while the exact same code works from a python console
session.

I'm guessing that in order to read or write files from any sort of a script
file sitting in the cgi-bin directory on a server, something has to be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.


So, what do you mean "refuses to work"? Is the cgi script not executing
at all? Spitting out an error? If so, what error? (And is it an error
to the browser calling the cgi script, or in your apache logs?)

Jeremy Jones
Jul 21 '05 #2
uwb
Jeremy Jones wrote:
uwb wrote:
I've got a call to glob in a .py file sitting in an apache cgi-bin
directory which refuses to work while the exact same code works from a
python console session.

I'm guessing that in order to read or write files from any sort of a
script file sitting in the cgi-bin directory on a server, something has to
be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.


So, what do you mean "refuses to work"? Is the cgi script not executing
at all? Spitting out an error? If so, what error? (And is it an error
to the browser calling the cgi script, or in your apache logs?)

Jeremy Jones

The script executes, no error messages, but the glob call turns up nothing
while the identical call running from a console does in fact turn up files
names as expected.
Jul 21 '05 #3
uwb wrote:
Jeremy Jones wrote:
uwb wrote:
I've got a call to glob in a .py file sitting in an apache cgi-bin
directory which refuses to work while the exact same code works from a
python console session.

I'm guessing that in order to read or write files from any sort of a
script file sitting in the cgi-bin directory on a server, something has to
be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.


So, what do you mean "refuses to work"? Is the cgi script not executing
at all? Spitting out an error? If so, what error? (And is it an error
to the browser calling the cgi script, or in your apache logs?)

Jeremy Jones

The script executes, no error messages, but the glob call turns up nothing
while the identical call running from a console does in fact turn up files
names as expected.

Wild guess, but I'm thinking your webserver process doesn't have
permissions to look in your directory.

Following is alternating root shell and IPython shell:

root@qiwi:~ # chmod 777 /bam
root@qiwi:~ # ls -ld /bam
drwxrwxrwx 2 root root 96 Jul 8 14:53 /bam

In [4]: glob.glob("/bam/*txt")
Out[4]: ['/bam/foo.txt', '/bam/bar.txt']

root@qiwi:~ # chmod 000 /bam
root@qiwi:~ # ls -ld /bam
d--------- 2 root root 96 Jul 8 14:53 /bam

In [5]: glob.glob("/bam/*txt")
Out[5]: []
HTH,

Jeremy Jones
Jul 21 '05 #4
uwb
Jeremy Jones wrote:
The script executes, no error messages, but the glob call turns up nothing
while the identical call running from a console does in fact turn up files
names as expected.

Wild guess, but I'm thinking your webserver process doesn't have
permissions to look in your directory.

Following is alternating root shell and IPython shell:

root@qiwi:~ # chmod 777 /bam
root@qiwi:~ # ls -ld /bam
drwxrwxrwx 2 root root 96 Jul 8 14:53 /bam

In [4]: glob.glob("/bam/*txt")
Out[4]: ['/bam/foo.txt', '/bam/bar.txt']

root@qiwi:~ # chmod 000 /bam
root@qiwi:~ # ls -ld /bam
d--------- 2 root root 96 Jul 8 14:53 /bam

In [5]: glob.glob("/bam/*txt")
Out[5]: []
HTH,

Jeremy Jones

Thanks! Thing does work when I do globs of the local apache directories.

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by glin | last post: by
reply views Thread by Juan Carlos CORU—A | last post: by
19 posts views Thread by Patrick Useldinger | last post: by
3 posts views Thread by J Poirier | last post: by
3 posts views Thread by seb | last post: by
7 posts views Thread by viscanti | last post: by
4 posts views Thread by care02 | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.