[Tutor] threading: getting latest elements from list/dict

2008-05-05 Thread Vaibhav.bhawsar
Hello I have a thread updating a dictionary with new elements. How can I check for new elements as they are inserted into the dictionary by the thread? In general is it safe to read a dictionary or a list while it is being updated by a running thread? Does the dictionary or list have to be locked

Re: [Tutor] threading: getting latest elements from list/dict

2008-05-05 Thread bob gailer
Vaibhav.bhawsar wrote: Hello I have a thread updating a dictionary with new elements. How can I check for new elements as they are inserted into the dictionary by the thread? In general is it safe to read a dictionary or a list while it is being updated by a running thread? Does the

[Tutor] free loop device

2008-05-05 Thread Nathan McBride
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey Guys, I have a program that uses the loop devices. However I originally was finding the free one with: 'losetup -f'. Which returns the next free loop device. :D However, I found that some of the other distros have a version of losetup that

Re: [Tutor] Looking for something similar to du...

2008-05-05 Thread Alan Gauld
Spencer Parker [EMAIL PROTECTED] wrote I am wondering if there is a way to do something that du does in Linux. I have several disk images and I need a way to get the size used...not the size of the image. If you type in du and the disk image path it gives you this number. is there anyway

Re: [Tutor] free loop device

2008-05-05 Thread bob gailer
Nathan McBride wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey Guys, I have a program that uses the loop devices. However I originally was finding the free one with: 'losetup -f'. Which returns the next free loop device. :D However, I found that some of the other distros have a

Re: [Tutor] Looking for something similar to du...

2008-05-05 Thread Marc Tompkins
On Mon, May 5, 2008 at 5:21 PM, Alan Gauld [EMAIL PROTECTED] wrote: Probably but I'm not totally clear what you are looking for. Can you explain what you mean by the diffrence between the size used versus the size of the image? Surely the size of the image is the space it uses? Or are you

Re: [Tutor] free loop device

2008-05-05 Thread Nathan McBride
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yup, I got some help in IRC. What I ended up doing was using regex to pull out each /dev/loopX. Then took the X and fed it to max which in turn gave me the highest numbered loop device in use. After which I then just added 1 to X and added it to

Re: [Tutor] Looking for something similar to du...

2008-05-05 Thread Spencer Parker
Mark is right...in that I don't want the actual size of the file itself...that I can get from another way in Python which i am already doing. I was mainly wondering if there was a way to do it and I was just missing something. I looked though stat() and that is basically what I wanted. I wasn't