Saving gif image to PRN.gif
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
While working under Wine in Linux Mint, tried to save an image with the name PRN.gif but got this error:
gifsave "gifsNewlyGenerated/PRN.gif
Problem Generating GIF, check memory and diskspace
I expected it to save normally as it is not "PRN" (printer device) but "PRN.gif"
Also noticed that the equivalent error message for BMPs is very different:
I guess it means "Could not open for writing". But the error is kinda misleading in that it seems to want to open a file that is not even created yet.
I installed wine on Fedora and reproduced the behavior you reported. On Windows 10, the behavior is the same, so Wine is faithfully reproducing the Windows behavior.
Wine also comes with a notepad app. I tried to save a file called "PRN.txt" and it said that the file already exists, then gave me an "Access Denied" error. I suspect that's what you're seeing.
There's no special code in FMSLogo to block creating a file name
PRN.gif, this comes from the operating system. It's possible to bypass this checking, but doing so causes compatibility problems for people who use Windows. For example, I created PRN.txt and notepad couldn't open it. Explorer showed it, but couldn't move the file to Recycling Bin or rename it. Therefore, I don't think it's a good idea to do this.However, if you want to do it, then use something like
Basically, you add
\\?\to the beginning of the file and use an absolute file path.