Re: Percentage complete of unix task
Re: Percentage complete of unix task
- Subject: Re: Percentage complete of unix task
- From: Rudi Sherry <email@hidden>
- Date: Thu, 24 Mar 2005 17:50:39 -0800
Hmm, I believe I saw a posting by Alan Turing asking the same
question... as I recall, he didn't think there was a way to do this ;)
Disk Utility and Installer can do this because they control everything
that's happening -- they don't just issue a single unix command and
wait for it to be done, "monitoring" the progress in some way. They
have a series of steps they go through and each step counts for some
known percentage... which eventually adds up to 100%.
If your task has a number of steps, do the same: test it out in some
different conditions, figure out approximately how long each step would
take as a percentage of the total, and increment your progress bar by
that much as each step ends.
If you want to issue a single unix command, it's much harder. You may
be able to pipe the output from the task into your app, and use that as
an estimation of how far you are, but you'd have to know in advance how
much output you're expecting for the entire thing. For instance, I
have a command that does a perforce sync (`p4 sync`) to a server; to
make the progress bar work, first I do a preview sync (`p4 sync -n`)
which gives me the same output but doesn't actually copy the files (so
it's fast); then I issue the actual `p4 sync`, monitoring the output
from that -- and since I know in advance how much output to expect, I
can show a progress bar.
Rudi
On Mar 22, 2005, at 5:44 PM, Rakka wrote:
Hi,
I'm pretty sure that this is a complicated question to answer, but:
Is there any way at all that I can determine how far a command, e.g,
repairing disk permissions (diskutil repairPermissions /) has gone?
I've seen apple apps such as Disk Utility and Installer have this
feature, but I can't see how it can be done.
Thanks in advance,
Rakka
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden