On 9 Feb 2011, at 03:12, Diwaker Gupta wrote:

> I'm trying to write a protoc plugin and struggling with a fairly basic task: 
> determining the name of the file to generate the output in.  In the 
> 'Generate' method, is there an easy way to determine the output file name 
> from the FileDescriptor object? In particular, for Java output, the protoc 
> compiler already has the logic to figure out the output file name given the 
> various options for package, outer class name, camel casing etc etc. It seems 
> redundant to replicate that logic in the plugin. Unless I misread the docs, 
> the current FileDescriptor API doesn't provide this information.
> If there are some fleshed out examples the community would like to share, I'd 
> really appreciate that.
> Diwaker

Well seeing as the filenames can change depending on the language and multiple 
files could possibly be generated I believe this is up to you to figure out. I 
wrote a plugin a while back for generating C code and I write output to 
original_file.proto.c and original_file.proto.h. FileDescriptor could not 
possibly give me that information.

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to