Jump to content
  • 0
Sign in to follow this  
ѕeмa™

Close Please Solved.

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.

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0

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?

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 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

Share this post


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

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

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