[Samba] PDF Print command

Charles Marcus CharlesM at Media-Brokers.com
Tue Mar 26 06:58:03 GMT 2002


> From: Martyn Ranyard [mailto:ranyardm at lineone.net]
> Sent: Tuesday, March 26, 2002 9:07 AM
> To: Charles Marcus
> Cc: Samba Maillist (E-mail)
> Subject: RE: [Samba] PDF Print command
>
> At 08:25 AM 3/26/02 -0500, Charles Marcus wrote:
>> I am very interested in setting up something like this for 
>> our network, and had a couple of questions:

> Always happy to help.

Thanks!

> The way Magic Scripts are implemented in samba is you open 
> them on the Client, close them, and they run on the server.
> THEY THEN GET DELETED, assuming the user connecting has
> permissions to delete files in the directory, which in unix
> is the same as being able to create files in the directory.

Ahh.  Yes, I really wish that Unix supported the secondary attributes that Windows does - one of the *very* few things that Windows does better, imho...

> This is an annoyance, but the way samba implements it.

Does Samba w/acl support support these extra Win file security attributes?

> I didn't want to touch the source as I might get tainted by C.

I have yet to get tainted by any programming language, but I have resigned myself to the fact that I'm gonna have to someday - probably sooner than later.

> Also, hiding it wouldn't help, as you could not then open it, 
> and anyway, my clients are all programmers and have all got
> "show all files" on.

Damn geeks...  ;)

> Could have, but couldn't really be bothered doing that much 
> work at that point, when a cron job only adds up to a minute 
> f time waiting for the pdf.

Yes - looks like what I was thinking won't work, so I'll be happy to settle for that as well.

> I'm gonna wait till VFS objects are stable.

Sounds like this is gonna be kewl.  They already have a network recycle bin working as a VFS object in HEAD, if I am not mistaken...

>>> so without any more delay, here's the script (remember to put
>>> it in crontab every minute - it checks if it has already
>>> processed the files before processing them again so it
>>> shouldn't be too processor intensive.)

>> Hmmmm... since I'm not a programmer, my ignorance is gonna 
>> be readily apparent here, but do you not delete the file once
>> the PDF has been created?  These things would pile up rather
>> quickly if not.

> I felt (as we were low-usage creators of PDF) that it may 
> come in handy to keep the PS file, as then we can take it
> straight into illustrator etc. and edit it without looking for
> the original.

I understand.  Any chance you could tell me what I'd need to add and where to the current script to make it delete the file after creating the PDF? Would be *much* appreciated!

> >Also, what happens if one with the same name already exists?
> 
> The script checks for Postscript files that have no pdf
> files created already, and then creates them, so if a pdf
> exists and a postscript file is created with the same name,
> it will not be overwritten.  That is by design, you could of
> course delete the postscript files, and then just remove the 
> if command to let all files be generated that aren't pdfs.

Hmmm... now if I change the script to delete the PS files after successful PDF creation, then I also have to change this to look for an existing filename with a PDF extension, instead of a PS file *and* a PDF file... its getting a little more complicated for me now...

> The point is, if someone calls their file "My letter.ps" or 
> "My letter.prn" it will create a "My letter.pdf" rather than
> some arbitrary name that Windows Printing specifies.

Very nice.  Now, if I can just figure out how to make the changes I need (or some kind soul makes them for me), I'll be set.

Thanks again!

Charles





More information about the samba mailing list