-
Notifications
You must be signed in to change notification settings - Fork 0
[BUG] (Read-only file system) error when saving IPP job files on AndroidΒ #2
Description
π Issue Description
Describe the bug:
When executing a print command from a remote client (e.g., macOS using lp), the Virtual Printer receives the IPP request but fails to save the job data due to a filesystem permission error:
β― lp -h Android_OKAN6RTJ.local:3000 -d "Virtual_Printer_(CPH2381)" /Users/username/Downloads/extensions.txt
lp: No such file or directoryDebug Logs:
ACTION START IPP VIRTUAL PRINTER
req:POST / from:fe80::1
Failed to save IPP job:
print_job_1745326755245.ipp: open failed:
EROFS (Read-only file system)
Root Cause:
The IPP server attempts to write the job file using File(filename).writeBytes(buffer) in a directory where it doesn't have write permissions. Android sandboxing likely defaults to a read-only path in some contexts.
β Suggested Fix
Use the app-specific storage directory (context.cacheDir or context.filesDir) for writing files instead of the default working directory.
Example fix:
val filename = File(context.cacheDir, "print_job_${System.currentTimeMillis()}.ipp")
filename.writeBytes(buffer)π This will ensure the app writes to a valid path with permissions on Android devices.
Let me know if you want help patching this or linking it with your Git commits!