rodyager / RWTS-PDFwriter

An OSX print to pdf-file printer driver
GNU General Public License v2.0
798 stars 77 forks source link

Not working on BigSur #24

Closed shaunpatterson closed 1 year ago

shaunpatterson commented 1 year ago

The directory it creates isn't a directory:

-rw-r--r--@   1 shaunpatterson  staff     18436 Dec 27 04:21 .DS_Store
drwxr-xr-x+ 310 shaunpatterson  staff      9920 Dec 27 04:29 ..
drwxr-xr-x   75 shaunpatterson  staff      2400 Dec 27 04:48 .
-rw-r--r--@   1 shaunpatterson  staff       876 Dec 27 04:48 PDFWriter

If I delete this then create it manually with mkdir ~/Documents/PDFWriter it still doesn't work. Printing from TextEdit yields nothing in this directory.

Darwin jalapeno.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
shaunpatterson commented 1 year ago

Well, the files are actually going to the spool directory:

/var/spool/pdfwriter/shaunpatterson

shaunpatterson@jalapeno/v/s/p/shaunpatterson> ls -ltra
total 1136
drwxr-xr-x  3 root            wheel     96 Dec 27 04:19 ..
-rw-rw-rw-@ 1 root            wheel      0 Dec 27 04:19 Icon?
-rw-------@ 1 shaunpatterson  staff  20343 Dec 27 04:19 Untitled 2.pdf
-rw-------  1 shaunpatterson  staff  20343 Dec 27 04:23 Untitled 2-1.pdf
-rw-------  1 shaunpatterson  staff  20343 Dec 27 04:25 Untitled 2-2.pdf
-rw-------  1 shaunpatterson  staff  20343 Dec 27 04:27 Untitled 2-3.pdf
-rw-------  1 shaunpatterson  staff  20343 Dec 27 04:36 Untitled 2-4.pdf
drwx------@ 9 shaunpatterson  staff    288 Dec 27 04:57 .
-rw-------@ 1 shaunpatterson  staff  47630 Dec 27 04:57 Untitled.pdf
rodyager commented 1 year ago

That’s because the “directory” it creates is a symbolic link to the actual location.

The actual location is where it is because the operating system tightly limits the locations to which printer drivers can write files as part of a “print” operation.

Rod

Sent from my iPhone

On 27 Dec 2022, at 8:59 pm, Shaun Patterson @.***> wrote:



Well, the files are actually going to the spool directory:

/var/spool/pdfwriter/shaunpatterson

@.***/v/s/p/shaunpatterson> ls -ltra total 1136 drwxr-xr-x 3 root wheel 96 Dec 27 04:19 .. -rw-rw-rw-@ 1 root wheel 0 Dec 27 04:19 Icon? -rw-------@ 1 shaunpatterson staff 20343 Dec 27 04:19 Untitled 2.pdf -rw------- 1 shaunpatterson staff 20343 Dec 27 04:23 Untitled 2-1.pdf -rw------- 1 shaunpatterson staff 20343 Dec 27 04:25 Untitled 2-2.pdf -rw------- 1 shaunpatterson staff 20343 Dec 27 04:27 Untitled 2-3.pdf -rw------- 1 shaunpatterson staff 20343 Dec 27 04:36 Untitled 2-4.pdf drwx------@ 9 shaunpatterson staff 288 Dec 27 04:57 . -rw-------@ 1 shaunpatterson staff 47630 Dec 27 04:57 Untitled.pdf

— Reply to this email directly, view it on GitHubhttps://github.com/rodyager/RWTS-PDFwriter/issues/24#issuecomment-1365771064, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAKSADIFDYQEL6WXTGCVP5LWPK4UXANCNFSM6AAAAAATKI7ZF4. You are receiving this because you are subscribed to this thread.Message ID: @.***>

shaunpatterson commented 1 year ago

Hmm, it's not a symbolic link.

rodyager commented 1 year ago

You are correct. Its a MacOS alias that points to /private/var/spool/pdfwriter/xxx

where xxx is whatever NSUserName() returns for the current user.

The easiest way to reveal the target location is to use Finder’s Info.

let theOrigURL = NSURL.fileURL(withPath: "/private/var/spool/pdfwriter/(NSUserName())")

   let theData = try! theOrigURL.bookmarkData(options: [URL.BookmarkCreationOptions.suitableForBookmarkFile],

includingResourceValuesForKeys: nil,

relativeTo: nil)

   try! URL.writeBookmarkData(theData, to:panel.url!)

Rod

On 28 Dec 2022, at 8:53 am, Shaun Patterson @.***> wrote:

Hmm, it's not a symbolic link.

— Reply to this email directly, view it on GitHubhttps://github.com/rodyager/RWTS-PDFwriter/issues/24#issuecomment-1366198214, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAKSADKUN5NPUIN4L7QO3YLWPNQOXANCNFSM6AAAAAATKI7ZF4. You are receiving this because you commented.Message ID: @.***>