Re: [Python-Dev] Compiling the source without stat

2011-12-15 Thread Martin v. Löwis
Am 15.12.2011 12:59, schrieb Hossein: > I wanted to say something in the bug page petri showed ( > http://bugs.python.org/issue12082 ) however I though about first > discussing it here. If faking a stat struct and a function to fill it > solves the problem, and checking for existing files and folde

Re: [Python-Dev] Compiling the source without stat

2011-12-15 Thread Victor Stinner
Le jeudi 15 décembre 2011 15:29:23 vous avez écrit : > If faking a stat struct and a function to fill it > solves the problem, and checking for existing files and folders is the > only thing that python needs to be compiled (i'm talking about 2.7) then > it's possible to fail-check it by just tryin

Re: [Python-Dev] Compiling the source without stat

2011-12-15 Thread Hossein Azadmanesh
It does have its own file handling functions: Opening, getting the size, enumerating directories, etc. It has its own limitations too. No dates supported, folders only one level deep, maximum 99 files inside each folder, etc. There is not a function called stat. But I am considering faking it, w

Re: [Python-Dev] Compiling the source without stat

2011-12-15 Thread Hossein
I wanted to say something in the bug page petri showed ( http://bugs.python.org/issue12082 ) however I though about first discussing it here. If faking a stat struct and a function to fill it solves the problem, and checking for existing files and folders is the only thing that python needs to

Re: [Python-Dev] Compiling the source without stat

2011-12-15 Thread Hrvoje Niksic
On 12/14/2011 05:04 PM, Hossein wrote: If there is anything I should do You can determine what the code that calls stat() is trying to do, and implement that with other primitives that your platform provides. For example, you can determine whether a file exists by trying to open it in read-

Re: [Python-Dev] Compiling the source without stat

2011-12-14 Thread Terry Reedy
On 12/14/2011 2:26 PM, Petri Lehtinen wrote: The problem boils down to the fact that you cannot really check whether a filesystem entry is a directory without calling stat() or fstat(). My personal opinion is that support for DONT_HAVE_STAT and DONT_HAVE_FSTAT defines should be dropped because

Re: [Python-Dev] Compiling the source without stat

2011-12-14 Thread Martin v. Löwis
> It's 99% definite that I can't compile further without touching the > source code. I have to #define my own PYOS_whatever and handle files in > my own way. In that case where should my special file handling cases go? It's difficult to say how to proceed. On one hand, I don't see an overwhelming

Re: [Python-Dev] Compiling the source without stat

2011-12-14 Thread Petri Lehtinen
Hossein wrote: > Hi. I just started to port latest python 2.7.2 to another platform > (don't think you're eager to know... well it's CASIO ClassPad). > And I faced a "minor" problem... It hasn't got stat or fstat or > anything. (It supports a very limited set of c std lib). > As pyport.c suggested,

[Python-Dev] Compiling the source without stat

2011-12-14 Thread Hossein
Hi. I just started to port latest python 2.7.2 to another platform (don't think you're eager to know... well it's CASIO ClassPad). And I faced a "minor" problem... It hasn't got stat or fstat or anything. (It supports a very limited set of c std lib). As pyport.c suggested, i defined both DONT_HA