[comp.unix.wizards] Occasionally lp cannot find my print file. Why?

duane@anasaz.UUCP (Duane Morse) (01/11/89)

Occasionally I try to enqueue a file for printing by

lp xxx

and lp comes back with a message saying that it cannot find "xxx". It
also cannot find it when I specify the file by ./xxx. I end up having
to cat the file and pipe it to lp. The file permissions are read/write
for everybody. Anybody have any idea what the problem might be?
-- 

Duane Morse	...!noao!{asuvax or nud}!anasaz!duane
(602) 861-7609

henk@bebux.UUCP (Henk Dijkstra) (01/13/89)

In article <1512@anasaz.UUCP> duane@anasaz.UUCP (Duane Morse) writes:
>Occasionally I try to enqueue a file for printing by
>
>lp xxx
>
>and lp comes back with a message saying that it cannot find "xxx". It
>also cannot find it when I specify the file by ./xxx. I end up having
>to cat the file and pipe it to lp. The file permissions are read/write
>for everybody. Anybody have any idea what the problem might be?

Have you checked the permissions of the parent directories? :-)


-- 
Henk Dijkstra	: BETRONIC B.V.			USENET : henk@bebux.UUCP
		: PO-box 4317				 ..!hp4nl!bebux!henk
		: 1009 AH AMSTERDAM, NL		VOICE  : (+31) 20 6652251
--------------------------------------------------------------------------------

wescott@sauron.Columbia.NCR.COM (Mike Wescott) (01/13/89)

In article <1512@anasaz.UUCP> duane@anasaz.UUCP (Duane Morse) writes:
> Occasionally I try to enqueue a file for printing by

> lp xxx

> and lp comes back with a message saying that it cannot find "xxx". It
> also cannot find it when I specify the file by ./xxx. I end up having
> to cat the file and pipe it to lp. The file permissions are read/write
> for everybody. Anybody have any idea what the problem might be?

Directory permissions in . or .. or ../..  etc.
Try checking read and search permissions for
the directories in the whole path.






-- 
	-Mike Wescott
	 mike.wescott@ncrcae.Columbia.NCR.COM

ccea3@rivm.UUCP (Adri Verhoef) (01/13/89)

>Occasionally I try to enqueue a file for printing by
>
>	lp xxx
>
>and lp comes back with a message saying that it cannot find "xxx".

>Duane Morse	...!noao!{asuvax or nud}!anasaz!duane

The program 'lp' is set[ug]id to user 'lp' and that's why...

	lp < file
also works, [as was pointed out], but only ONE file at a time can be queued.
Now for the solution.  Over here we use 'llp':

	llp -dclaser -ob -og -t1+2 file1 file2

'llp' understands all 'lp' options.  In fact 'llp' just passes
its options on to 'lp'.
'llp' takes multiple file arguments, concatenates the files,
each separated by a formfeed, and the resulting output will be
standard input to 'lp'.  Only one queue-id is used.

SYNOPSIS
  llp [lp-options] [files]

#-------------- snip 8< snip 8< snip --------------- BEGIN
#ident "@(#)llp.sh	(a3)	1.0	17 nov 1988"
# Usage: llp [lp-options] [files]

for arg
do
  case $arg in
    -*) shift;;
    *) break;;
  esac
  case $arg in
    -o*)
	t=	# take special care of white space
	for i in $arg
	do
	  if [ -z "$t" ]; then t=$i; else t=-o$i; fi
	  oopt="$oopt $t"
	done
	;;
    -t*)
	topt="$arg";;  # take special care of white space
    -*)
	mopt="$mopt $arg";;
  esac
done

# If there are no filearguments, use the standard input.
if [ $# = 0 ]
then
  cat
else
  for file
  do
	[ -n "$cat0" -a -z "$cat1" ] && echo "\0014\c"
	if cat "$file"
	then
		cat0=0
		cat1=
	else
		cat1=1
	fi
  done
fi |
  lp ${mopt} ${topt+"$topt"} ${oopt}

exit $?
#-------------- snip 8< snip 8< snip --------------- END

# Hey, Duane, if the uucp routing tables still say that the path to
# anasaz is ellymae!anasaz, I won't be able to reach you via e-mail.
# Could you please have this fixed up?
# How and when do I know when this is done?

friedl@vsi.COM (Stephen J. Friedl) (01/13/89)

In article <1512@anasaz.UUCP>, duane@anasaz.UUCP (Duane Morse) writes:
> Occasionally I try to enqueue a file for printing by
> 
> 	lp xxx
> 
> and lp comes back with a message saying that it cannot find "xxx". It
> also cannot find it when I specify the file by ./xxx. I end up having
> to cat the file and pipe it to lp. The file permissions are read/write
> for everybody.


This is probably under System V.  The lp command is usually setuid "lp"
and setgid "bin", so an inaccessible *parent* directory will yield one
of these "cannot access" messages.  Rather than cat the file and pipe it
to lp, do:

	lp < xxx

This misfeature is fixed in System V Release 3.2 (on the 3B2, at least).

     Steve

-- 
Stephen J. Friedl        3B2-kind-of-guy            friedl@vsi.com
V-Systems, Inc.        I speak for me only      attmail!vsi!friedl
Santa Ana, CA  USA       +1 714 545 6442    {backbones}!vsi!friedl
---------Nancy Reagan on Hawaiian musicians: "Just say Ho"--------