473,386 Members | 1,830 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,386 software developers and data experts.

Win98 - exceptions.IOError: (13, 'Permission denied')

Hi to everyone,

I have a Service, that runs on a WinXP machine. The service read a file
on a Win98 machine and write the content in a file on the WinXP machine.
After tree times I get the error message exceptions.IOError: (13,
'Permission denied').

The following things I have already tested:

- The file on Win98 machine could be deleted, so the file is closed
correctly.
- Stop an restart the service on WinXP, will have no effect
- Reboot the Win98 machine solve the problem for three times. So I have
the same issue explained above.
- I have changed the intervall from 5 sec to 1 minute. After ther first
time I get the error message.
- Using a Win2000 or WINXP machine instead of the Win98 machine. That
works. But unfortunatly the PC to access is a Win98 and I have no
influence to decide for upgrade.

I can't figure out, what's the problem.

This is the code to simulate my actual problem:

# -*- coding: iso-8859-1 -*-

import win32serviceutil
import win32service
import win32event
import pywintypes
import win32file
import win32pipe
import win32api
import win32con
import thread
import ntsecuritycon
import os
import sys

class MyService(win32serviceutil.ServiceFramework):
"""NT Service."""

_svc_name_ = "TCTest"
_svc_display_name_ = "TCTest"

def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.stop_event = win32event.CreateEvent(None, 0, 0, None)
self.overlapped = pywintypes.OVERLAPPED()
self.overlapped.hEvent = win32event.CreateEvent(None,0,0,None)
self.thread_handles = []

def SvcDoRun(self):
import servicemanager

servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STARTED,
(self._svc_name_, '')
)

while 1:
datei = open(r'\\ipcwin98\test\test.txt', 'r')
log = open(r'c:\log.txt', 'a')
log.write(datei.read())
datei.close()
log.close()

if win32event.WaitForSingleObject(self.stop_event, 5000) ==
win32event.WAIT_OBJECT_0:
break

servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STOPPED,
(self._svc_name_, '')
)

def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP _PENDING)
win32event.SetEvent(self.stop_event)

if __name__ == '__main__':
win32serviceutil.HandleCommandLine(MyService)
Thanks in advanced for your help.
bye
Robert

Feb 9 '07 #1
0 1557

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

Similar topics

2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
1
by: Jake Barnes | last post by:
I can not figure out the meaning of this error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: http://www.bluecasts.com/pdsIncludes/pdsAjax.js ::...
4
by: zombek | last post by:
I'm making a small program which takes a folder with images and generates optimized normal-sized images and thumbnails using Python Imaging Lbrary (PIL). The problem is here: ........
6
by: Antoine De Groote | last post by:
Google tells quite some things about it, but none of them are satisfactory. I'm on Windows, and shutil operations (e.g. move, copy) throw Permission denied all the time, for the source files. It...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: Simo D | last post by:
Hi, I'm using a script.py to write a file in a dir on the server. Mod_python work but i get: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File...
0
by: Simo D | last post by:
Ok, solved: apache is unable to follow relative paths from the script. Putting ol absolute paths it's ok! Simo D wrote: -- View this message in context:...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.