Jump to content
  • 0

Close Please Solved.


ѕeмa™

Question

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.

Link to comment

5 answers to this question

Recommended Posts

  • 0
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.

  • Love 2

Plain logic saves lives.

Link to comment
  • 0
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.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.