Re: os.access with wildcards

2005-10-16 Thread mike
os.path.exists() -- http://mail.pyth

Re: os.access with wildcards

2005-10-08 Thread mike
ugly. i guess this thread shows that you are clueless regarding your thread crapping. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.access with wildcards

2005-10-08 Thread Fredrik Lundh
> > if glob.glob(...): ... > > As for your possible solutions, if you consider any > of yours to be "readable", then i have no interest in > coding with you. > > if glob.glob(...): ... > > I guess, for readability, nothing has come up that > seems _great_. > > if glob.glob(...): ... > > It works,

Re: os.access with wildcards

2005-10-07 Thread mike
Hi Dan, It works, it's elegant, and it uses python strengths. I guess I have to settle the question of who my audience is. That is who do I want to make it readable for. All the solutions so far require some python specific knowledge, and there are some which are horendous even at that. Perhaps

Re: os.access with wildcards

2005-10-07 Thread Dan Sommers
On 7 Oct 2005 16:17:22 -0700, "mike" <[EMAIL PROTECTED]> wrote: > Thanks Mike. Would there be an idiom using "is"? > somethng like > glob.glob('2005*) is not Empty > I have not figured out what to put on the right hand > side of "is" Don't put anything there: if glob.glob('2005*'):

Re: os.access with wildcards

2005-10-07 Thread mike
Thanks Mike. Would there be an idiom using "is"? somethng like glob.glob('2005*) is not Empty I have not figured out what to put on the right hand side of "is" I guess, for readability, nothing has come up that seems _great_. One last effort would be to hide the code behind a method, and u

Re: os.access with wildcards

2005-10-07 Thread Mike Meyer
"mike" <[EMAIL PROTECTED]> writes: > Test for the existence of one or more matches of the wildcard > expression. > > For example: > > Are there any files that begin with 2005? > > This doesn't work (wish it did): > os.access('2005*',os.F_OK) I would considering it suprising if it worked.

Re: os.access with wildcards

2005-10-07 Thread mike
No need to apologize for continuing to waste your time, self.plonk. Get a life, though, and you'll be happier. As to your question, well, not before you apologize for thread crapping. As for your possible solutions, if you consider any of yours to be "readable", then i have no interest in coding

Re: os.access with wildcards

2005-10-07 Thread Fredrik Lundh
"mike" wrote: > dude, you are the sap that wrote "it's not clear". followed by three possible solutions to the stated problem, one of which was marked as "most likely". > get a life. oh, sorry for wasting my time. can I *plonk* you now? -- http://mail.python.org/mailman/listinfo/python-l

Re: os.access with wildcards

2005-10-07 Thread mike
dude, you are the sap that wrote "it's not clear". get a life. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.access with wildcards

2005-10-07 Thread Fredrik Lundh
"mike" wrote: > Test for the existence of one or more matches of the wildcard > expression. why are you reposting variations of your question (in duplicates) instead of reading the replies? that's not a good way to pass the turing test. -- http://mail.python.org/mailman/listinfo/python-lis

Re: os.access with wildcards

2005-10-07 Thread mike
Test for the existence of one or more matches of the wildcard expression. For example: Are there any files that begin with 2005? This doesn't work (wish it did): os.access('2005*',os.F_OK) However, these work arounds do the job: glob.glob('2005*')==[] as does this bash command:

Re: os.access with wildcards

2005-10-07 Thread mike
Test for the existence of one or more matches of the wildcard expression. For example: Are there any files that begin with 2005? This doesn't work (wish it did): os.access('2005*',os.F_OK) However, these work arounds do the job: glob.glob('2005*')==[] as does this bash command:

Re: os.access with wildcards

2005-10-07 Thread Fredrik Lundh
Leif K-Brooks wrote: >>os.access(path,mode) >> >> where path may contain linux style wildcards. > > os.access(glob.glob(path), mode) Traceback (most recent call last): File "", line 1, in ? TypeError: access() argument 1 must be string, not list it's not clear from the OP if he wants

Re: os.access with wildcards

2005-10-07 Thread mike
thanks Leif. poor question on my part. I had been using glob.glob(path)==[] and was looking for something more readable, hence os.system('[ -e %s ]' % path ) but that doesn't seem like a good idiom for crossplatform. I thought there may either be a way to escape the wildcards, or an

Re: os.access with wildcards

2005-10-07 Thread mike
thanks Leif. poor question on my part. I had been using glob.glob(path)==[] and was looking for something more readable, hence os.system('[ -e %s ]' % path ) but that doesn't seem like a good idiom for crossplatform. I thought there may either be a way to escape the wildcards, or an

Re: os.access with wildcards

2005-10-06 Thread Leif K-Brooks
mike wrote: > i'd like to use > >os.access(path,mode) > > where path may contain linux style wildcards. os.access(glob.glob(path), mode) -- http://mail.python.org/mailman/listinfo/python-list

os.access with wildcards

2005-10-06 Thread mike
i'd like to use os.access(path,mode) where path may contain linux style wildcards. i've failed so far. my workaround is the bash command. os.system('[ -e %s ]' % fn ) any suggestions? -- http://mail.python.org/mailman/listinfo/python-list