diff options
author | TheTroll <trolldev@gmail.com> | 2010-04-01 15:03:36 +0200 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-04-01 15:03:36 +0200 |
commit | d6420501bc777be979d89171e7ed131273d97c58 (patch) | |
tree | a36fbfb4169383c55ff43ed1fee4f55a54568bc7 | |
parent | f71315d724f52551980f50b446697fe6130fc451 (diff) | |
download | istreamdev-d6420501bc777be979d89171e7ed131273d97c58.tar.gz istreamdev-d6420501bc777be979d89171e7ed131273d97c58.tar.bz2 |
Error handling
-rwxr-xr-x | bin/istream.sh | 6 | ||||
-rw-r--r-- | bin/streaminfo.php | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/istream.sh b/bin/istream.sh index 09503d3..1e843e0 100755 --- a/bin/istream.sh +++ b/bin/istream.sh @@ -31,6 +31,12 @@ fi # sending it to the segmenter via a PIPE ############################################################## +# Check that the session dir exists +if [ ! -e ../ram/$SESSION ] +then + exit; +fi + cd ../ram/$SESSION # Create a fifo diff --git a/bin/streaminfo.php b/bin/streaminfo.php index 8b935ef..130d0f9 100644 --- a/bin/streaminfo.php +++ b/bin/streaminfo.php @@ -15,7 +15,9 @@ function writeinfostream($session, $type, $mode, $url, $channame) $ram = "../ram/" .$session ."/"; - $infofile = fopen($ram ."streaminfo", 'w'); + $infofile = @fopen($ram ."streaminfo", 'w'); + if (!$infofile) + return; fwrite($infofile, "type=" .$type ."\n"); fwrite($infofile, "mode=" .$mode ."\n"); @@ -33,7 +35,7 @@ function readinfostream($session) if (!file_exists($ram ."streaminfo")) return array("none"); - $infofile = fopen($ram ."streaminfo", 'r'); + $infofile = @fopen($ram ."streaminfo", 'r'); if (!$infofile) return array("none"); |