Peter Naulls wrote:
Duncan Moore wrote:
I'm using GCC 4.1.1 release 1b on a VRPC.

#include <stdio.h>         // fopen
#include <unixlib/local.h> // __riscosify_control
int __riscosify_control;

int main(void) {

 __riscosify_control|=__RISCOSIFY_NO_PROCESS;
 fopen("rrr/pdf","w");

 __riscosify_control&=~__RISCOSIFY_NO_PROCESS;
 fopen("uuu.pdf","w");

 return 0;
}

gcc filetype.c
a/out

This gives uuu/pdf filetyped as Pdf, but rrr/pdf filetyped as Text.

Right, "no process" means just that.  And setting the filetype is
part of the processing.  Perhaps you want to look at the
FILETYPE_NOT_SET flag, although I can't promise that that the result
will be what you expect if no other processing is done.

That's right, FILETYPE_NOT_SET is ignored if __RISCOSIFY_NO_PROCESS is set.

> Am I missing something obvious, is this intentional behaviour, or is
> it a bug? If it's a bug I'll add it to Bugzilla

What would not be clear in any bug report, is exactly what you
were expecting, and why.

I was expecting/hoping that both files would be filetyped as Pdf. The reason is that if I write a program that I want to use Unix format filenames, I unset __RISCOSIFY_NO_PROCESS and I get automatic filetyping of newly created files. On the other hand, if I want the program to use RISC OS format filenames, I set __RISCOSIFY_NO_PROCESS, but then I don't get the automatic filetyping, which seems inconsistent.

Is there some other way of getting automatic filetyping of files if I want a program to use RISCOS format filenames?


_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to