ѕeмa™ 308 Posted February 24, 2014 Share Posted February 24, 2014 Hi all persons, i need one script in freebsd to read al quest in the folder quest and put in quest_list automatic Here one example with python import app self.__AppendFileList("quest") def __AppendFileList(self, extension): carpeta=app.GetFileList("/usr/home/game/share/locale/germany/quest/*."+extension) for archivo in carpeta: self.sema = open("quest_list2", "w") self.sema.write(archivo + "n") self.sema.close() Any person know how put this in freebsd? Thanks. https://m2admin.net/ Link to comment Share on other sites More sharing options...
Mercury 5 Posted February 24, 2014 Share Posted February 24, 2014 You are trying to read a file located inside the server and I think that's impossible, you could do it from a web server I'm understanding that this is a client-side script, or am I mistaken? Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted February 24, 2014 Author Share Posted February 24, 2014 no, no is a client-side script, i need create a script "shell" in freebsd example start.sh performing the same function written in python https://m2admin.net/ Link to comment Share on other sites More sharing options...
Pepineitor 69 Posted February 24, 2014 Share Posted February 24, 2014 ls *.quest >> quest_list 1 Link to comment Share on other sites More sharing options...
Aveline™ 554 Posted February 24, 2014 Share Posted February 24, 2014 import os def AppendPathName(pathName): if(pathName == ""): return -1 else: listQuest = [q for q in os.listdir(pathName) if(q.endswith('.quest'))] file = open("quest_list","w+") for i in xrange(len(listQuest)): file.write(listQuest[i] + "n") AppendPathName("/usr/home/game/share/locale/germany/quest") Regards. 2 Plain logic saves lives. Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted February 24, 2014 Author Share Posted February 24, 2014 import os def AppendPathName(pathName): if(pathName == ""): return -1 else: listQuest = [q for q in os.listdir(pathName) if(q.endswith('.quest'))] file = open("quest_list","w+") for i in xrange(len(listQuest)): file.write(listQuest[i] + "n") AppendPathName("/usr/home/game/share/locale/germany/quest") Regards. Thanx but i'm not searching a python script, only shell script. Thanks pepineitor i go to try it. Function Pepineitor. https://m2admin.net/ Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now