473,796 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1664
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1837
by: glin | last post by:
Hi I am trying to integrate the xmlrpc server into a class, does anyone know how to get it working? test.html: <html> <head> <title>XMLRPC Test</title> <script src="jsolait/init.js"></script> <script src="jsolait/lib/urllib.js"></script> <script src="jsolait/lib/xml.js"></script>
0
1743
by: Juan Carlos CORUÑA | last post by:
Hello all, I'm trying to create a COM Server with an embedded xmlrpc server. Here is way it must work: - The client application (programmed with a COM capable language) instantiates my COM server (programmed with python). - The COM server must have a connect interface in order to let the client application process the xmlrpc request. - After executing a "serveforever" method on the COM server it begins
19
3183
by: Patrick Useldinger | last post by:
Hi all, after my unsuccessful try to run Apache 2 with mod_python and Python 2.3, I am looking for an alternative approach. My aim is to write a small web-based application: Python - the solution must be based / usable on Python 2.3 Portability Targeted plaforms are
3
1691
by: J Poirier | last post by:
Hi All, I'm hoping that someone might have some pointers or examples on how to proceed with a solution to the following problem: A test application, which produces a trace file, is being run for very long periods of time. Say 72 hours or more.
2
1956
by: john14 | last post by:
Hi, I have an xmlrpc server. I using the python package xmlrpc. Here is what I am doing: s = xmlrpc.server() s.addMethods(method_hash) s.bindAndListen(PORT) while 1: try:
1
2388
by: fortepianissimo | last post by:
I have a simple xmlrpc server/client written in Python, and the client throws a list of lists to the server and gets back a list of lists. This runs without a problem. I then wrote a simple Java xmlrpc client and it calls the python server. But I can't figure out what type to cast the result (of type Object) to. The Java xmlrpc call is basically this: Object result = client.execute("MyFunction", params);
3
1607
by: seb | last post by:
Hi, I am writing to a file some basic information using the logging module. It is working but in the log file some line are printed several time. I had put some print debugging messages in the logging function (so they appear on the consile) and they are called once only. Obviously there is some understantding of the logging module that I am missing. My simple logging program (see below) is called by several processes. In this way I...
7
2195
by: viscanti | last post by:
Hi, I'm trying to create an XMLRPC server using apache + python (cgi). It's not too difficult to configure everything, but I would like to tune it in order to receive up to 2000 calls per minute without any problems. Do Pthon CGIs use threading? I need to make it very efficient, but I haven't found much information about Python CGI optimization. The called function will update a table in a mysql db. I will use triggers to export data from...
4
3943
by: care02 | last post by:
I have implemented a simple Python XMLRPC server and need to call it from a C/C++ client. What is the simplest way to do this? I need to pass numerical arrays from C/C++ to Python. Yours, Carl
0
9531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.