The most likely thing is that the drive hasn't yet been mounted. Removable storage drives such as USB drives, CDs and DVDs are usually mounted by the automounter. However, it is possible that your script is running before the automounter starts. Check to see the relative order of the automounter script (which on my FC5 system is called autofs) and your script.
Another possibility is that gnome may be doing something clever to mount the drive. Can you get your script to do issue a [tt]mount[/tt] command and capture the output so we can see whether the drive is actually mounted or not.
Are you detecting your file using ls by the way? If so, there's a better way; use the following code instead:
Code:
[ -f "/media/CANON_DC/file_xyz" ]
The [] indicate that it's a boolean test. This will return a 0 or 1. -f tells it to look for the existence of a file. You could then combine this with an if statement, thus:
Code:
if [ -f "/media/CANON_DC/file_xyz"] ; then
echo "good, file exists"
else
echo "bad, can't find file...HELP!"
fi
To detect a directory, use -d in place of -f.