I am currently writing a plugin-based server for the VK social network. The plugin system is YAPSY, and the process is being backgrounded using
I have written a file server plugin for the said server. It works just fine after I launch it, but when I close the terminal session I used to launch it (I run it as root), the
LIST command, which used to return the file/folder list just fine, begins to throw
[Errno 5] Input/output error.
I am using
os.listdir for getting the folder content as follows:
elif cmd == u'list': flist = os.listdir(self.cwd+'/'+('' if len(args)==0 else args)) otp = "Listing of "+(self.cwd.replace(self.topdirpath, "<root>") if len(args) == 0 else self.cwd.replace(self.topdirpath, "<root>")+"/"+args)+':\n' num = 0 flist.sort() for fi in flist: otp += "["+str(num)+"] "+('-DIR- ' if os.path.isdir(self.cwd+'/'+('' if len(args)==0 else args)+'/'+fi) else '')+str(fi)+"\n" num += 1 self.fSay(otp,vk,'200 LIST OK') return True
While I didn't close the SSH session that I started the server from, it works just fine:
>> #$list << Listing of <root>:  -DIR- AniArt  -DIR- gifs  -DIR- inbox
However once I log off SSH, things go weird:
>> #$list << libakcore longpoll server There was an error processing your request. More info: [Errno 5] Input/output error
Since no change was done to the folder contents, and it is accessible manually from the same user, I have no idea except for that the problem is in either
os.listdir() or possibly both at the same time. However it is certain that it doesn't matter whether I call it from a separate thread or right from the forked-off server thread.
Any help would be much appreciated. Thanks in advance.