[Wine] File access denied when printing from a Delphi application

marcos_antonio_ps wineforum-user at winehq.org
Mon Apr 27 08:15:31 CDT 2009


Hello, everybody!

I'm getting the following error when I'm trying to print from a Delphi application:

File access denied.

This printer routine in my application is a routine to print text. So it prints to a file
in LPT1 . The source code is more or less like this:


Code:
procedure Print;
var
  File: TextFile;
begin
  AssignFile(File, 'LPT1');
  Rewrite(File);
  try
    Writeln(File, '...');
    // ...
  finally
    CloseFile(File);
  end;
end;



I think the error occur in the AssignFile or Rewrite procedures, when the application tries to generate the file that will hold the printing on the system. I'm almost sure that if I execute my application on Wine under root or superuser the printing will work, but we all know that we should not execute applications on Wine like that. So what's the solution to have file access in this case?

Thank you.

Marcos







More information about the wine-users mailing list