[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash, find and error message question

On Sat 01 Feb 2020 at 13:38:55 (-0500), songbird wrote:
> Reco wrote:
> > On Sat, Feb 01, 2020 at 12:36:28PM -0500, songbird wrote:
> >> the directory is a mount point of a device in limbo.
> >> it is showing up as mounted but it really isn't (the
> >> device is turned off).
> > ...
> >> 
> >>   i just want the answer to be 0 or the number of files.
> >
> > Fuse does not work that way. If a userspace backend cannot perform its
> > function (in this case - a device is disconnected) - it's free to return
> > all kinds of error even on a simple opendir(3).
> >
> > Best you can do is to execute:
> >
> > fusermount -u /home/me/pics/camera
>   i don't care if it is returned, i just wonder why it isn't
> redirected to /dev/null like i'm asking it to do.
> >>   i am using the above in a bash script so i don't want
> >> any error messages coming from the script itself unless
> >> i print them myself.
> >
> > If you need an answer whenever a camera is plugged on or not - why don't
> > you check for the device itself? I.e. lsusb and friends.
>   i check via the mount command but as i've found out it
> isn't really reliable because in fact it is mounting something
> even if it isn't there.
>   as it is i have to tell the camera to be unmounted via gio
> because when i plug the camera in the automounting happens
> even if i tell the system to not do anything.
>   and yes, i'm annoyed at systems that don't do what you tell
> them to do.  the reason i'm writing this whole thing is because
> i dislike all the stupid assumptions and baked in crap that
> the camera manufacturer wants someone to jump through.  no.  the
> USB connection works as it should, leave me alone.  grrr!
>   so i almost have my camera script done but there's these
> last niggling bits i'd like to iron out.
>   thanks for the suggestion about lsusb.  that will at least
> get around the main PITA i'm hitting.  :)

My question would be:

Which directory is your current directory—what does pwd say?
After all, the error messages say "reading directory '.': Protocol error",
and not knowing where you are is unsettling for any command.


Reply to: