- phpDock
2 weeks 5 days ago - php app to GTK app
2 weeks 6 days ago - PHP-GTK applications can use MySQL
3 weeks 5 hours ago - Contact forms
4 weeks 1 day ago - I just setup drupal cms and
5 weeks 3 days ago - Re: Offer of permanent job for PHP-GTK programmer
5 weeks 6 days ago - Ok...
13 weeks 40 min ago - Welcome to PHP-GTK
25 weeks 7 hours ago - 404 reached :(
30 weeks 6 days ago - pkTail - new versions
32 weeks 4 days ago

phpISO is very small, but very easy to use and very fast.
It only works under Linux! You enter a device, for example
Comments
alternative
Not sure what the point is ; it seems to be equivalent to:
cat /dev/cdrom > image.isoyes
yes, but it's graphical application. It would be interesting to show a progress bar. Don't know how to get ISO size.
perhaps a solution for size
this function works for CD, CD audio, but not exactly right size returned ; but does not works for DVD (return 50% of real size) ; may not work with multi-session CD/DVD.
<?php
function seek_size($dev, $debug=false) {
$dev = @fopen($dev,"r");
if (!$dev) return FALSE;
$size = 0;
$block_size = 1024 * 1000;
/* should return file size ; does not work with /dev/cdrom devices
fseek($dev, 0, SEEK_END);
$filesize = ftell($dev);
if($pos === false)
echo "ftell error\n";
else
echo "filesize = $filesize\n";
*/
$size = 0;
$block_size = 1024 * 1000 * 10;
while (fseek($dev, $block_size, SEEK_CUR) != -1) {
$size++;
$pos = ftell($dev);
if($pos == false)
echo "error\n";
elseif($debug){
echo "."; flush();
}
}
fclose($dev);
if($debug){
echo "size = $size\n";
echo "pos = $pos\n";
}
return $size;
}
?>
DVD size
For DVDs and larger media, you have to take into account the fact that the size is larger than 2GB, meaning traditional (signed) long integers, which are 31 bits wide, will suffer from folding. Even unsigned integers, at 32 bits, will be truncated too.
Using either GMP or bcmath to obtain arbitrary precision might be required.
Progressbar
Hi,
I didn't add a progressbar because I wanted to avoid traffic.
But I think I will add a progressbar. But first I have to find a solution for getting the size of a CD.
size info
- for DVD, there is an external command available on linux : lsdvd ; there is some options and is easy parsable.
- for IO, I think you should use IO_add_watch ; this allow a non-blocking IO system. Here is the synopsys :
- $conditions = (Gtk::IO_IN, Gtk::IO_OUT, IO_PRI, IO_ERR, IO_HUP, IO_NVAL);
- $id = io_add_watch($stream_rsrc, $condition, $callback);
- $id = io_add_watch($stream_rsrc, $condition, $callback, $priority);
you can find some sample script here or anywhere.
phpISO 0.2
Hi,
I finished phpISO 0.2.
phpISO 0.2 need
dfto get the size of the CD. The CD has also to be mounted.Have fun ;)