File operations

2008-09-10 Thread aditya shukla
Hello folks, I am using Python-2.5.2 on fedora 9 sulphur -2.6.25-14.fc9.i686.I am creating a temporary file , in which data is written by another program and then i am using that temporary file to do my computations.I am new to linux and i am facing two issues homedir = os.path.expanduser('~')

Re: File operations

2008-08-22 Thread Fredrik Lundh
John Machin wrote: and don't use the name of the built-in file function as one of your own names "file" is a type, not a function, and has been removed in 3.0. given that "file" is hardly ever used in properly written Python 2 code (if you need to check for file-like behaviour in Python 2, c

Re: File operations

2008-08-21 Thread John Machin
On Aug 22, 9:33 am, Gary Herron <[EMAIL PROTECTED]> wrote: > aditya shukla wrote: > > Hello guys > > > I am trying to search a file say xyz.txt > > > after searching i get the location of the file in > > > search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" > > > now how should i op

Re: File operations

2008-08-21 Thread Gary Herron
aditya shukla wrote: Hello guys I am trying to search a file say xyz.txt after searching i get the location of the file in search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" now how should i open this file i can use file=open("c:\\abc\\xyz.txt","rb") but i have to use search

File operations

2008-08-21 Thread aditya shukla
Hello guys I am trying to search a file say xyz.txt after searching i get the location of the file in search_file (containing abspath) ,eg search_file="c:\\abc\\xyz.txt" now how should i open this file i can use file=open("c:\\abc\\xyz.txt","rb") but i have to use search_ file How can this be

Re: file operations.

2008-07-25 Thread Fredrik Lundh
aditya shukla wrote: Guys thanks for your previous help .I have a doubt again (I'm sure you mean "a question"; in english, "a doubt" is something slightly different, and quite often more negative.) Also , because of this i am not able to extract the floating point values ie 0.50,0.50,0.66

Re: file operations.

2008-07-24 Thread Terry Reedy
aditya shukla wrote: Guys thanks for your previous help .I have a doubt again My text file is :- 0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll ... now this is what happens >>> x=open("c:\\test2.txt","rb") >>> x.readline() '\n' ---? i am not able to understand why is new line charac

File operations.

2008-07-24 Thread aditya shukla
Guys i just understood the problem.Thanks for all your help Aditya -- http://mail.python.org/mailman/listinfo/python-list

file operations.

2008-07-24 Thread aditya shukla
Guys thanks for your previous help .I have a doubt again My text file is :- 0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll 0\9\10\11|0.50|c:\windows\apppatch/AcRedir.dll 0\9\10|0.66|c:\windows\apppatch/AcSpecfc.dll 0\9|0.83|c:\windows\apppatch/iebrshim.dll 0|0.92|c:\windows\apppatch/pcamain.sdb

Re: WANTED: logging of all file operations on Windows

2006-07-10 Thread Tim Golden
[Tim Golden] >> On the offchance that you haven't seen it, you might >> look at this: >> >> http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html#use_readdirectorychanges >> [Claudio Grondi] > It seems, that it will be necessary to use some logic based on the > sequence

Re: WANTED: logging of all file operations on Windows

2006-07-10 Thread Tim Golden
Claudio Grondi wrote: > Here a small update to the code at > http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html#use_readdirectorychanges > : > > ACTIONS = { >1 : "Created", >2 : "Deleted", >3 : "Updated", >4 : "Renamed from something" >5 : "Renamed to

Re: WANTED: logging of all file operations on Windows

2006-07-10 Thread Claudio Grondi
Tim Golden wrote: > Claudio Grondi wrote: > >> I am aware, that it is maybe the wrong group to ask this question, but >> as I would like to know the history of past file operations from >> within a Python script I see a chance, that someone in this group was >>

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Claudio Grondi
Tim Golden wrote: > Claudio Grondi wrote: > >> I am aware, that it is maybe the wrong group to ask this question, but >> as I would like to know the history of past file operations from >> within a Python script I see a chance, that someone in this group was >>

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Claudio Grondi
e hard drive(s) unnecessary wasting much energy and getting hot. Claudio Grondi > > > Claudio Grondi wrote: > >>I am aware, that it is maybe the wrong group to ask this question, but >>as I would like to know the history of past file operations from within >>a Py

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Paul McGuire
"faulkner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > you want a directory watching daemon. it isn't hard at all to build > from scratch. > first, determine which directories should be watched. > then, os.walk each directory, building a mapping from filename to mtime > [modified

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Paul McGuire
"faulkner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > you want a directory watching daemon. it isn't hard at all to build > from scratch. > first, determine which directories should be watched. > then, os.walk each directory, building a mapping from filename to mtime > [modified

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Tim Golden
Claudio Grondi wrote: > I am aware, that it is maybe the wrong group to ask this question, but > as I would like to know the history of past file operations from within > a Python script I see a chance, that someone in this group was into it > already and is so kind to share here hi

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread faulkner
ave looked for this that i'll just write a generic one and put it in the cheeseshop. look for "dirmon" in about a week. Claudio Grondi wrote: > I am aware, that it is maybe the wrong group to ask this question, but > as I would like to know the history of past file operations

WANTED: logging of all file operations on Windows

2006-07-09 Thread Claudio Grondi
I am aware, that it is maybe the wrong group to ask this question, but as I would like to know the history of past file operations from within a Python script I see a chance, that someone in this group was into it already and is so kind to share here his experience. I have put already much