Issue 55862 - Set creator type when creating new files
Summary: Set creator type when creating new files
Status: ACCEPTED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: 680m133
Hardware: Mac Mac OS X, all
: P4 Trivial (vote)
Target Milestone: 4.x
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: aqua
Depends on:
Blocks:
 
Reported: 2005-10-12 20:11 UTC by tino.rachui
Modified: 2017-05-20 11:29 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
creator as it should appear ? (38.09 KB, image/png)
2008-09-18 18:21 UTC, eric.bachard
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description tino.rachui 2005-10-12 20:11:54 UTC
This is for saving files. Since many long-time Mac users save files without extensions, the Finder relies 
on the file's type or creator code to match extension-less files to an application. 
This patch was suggested by p.Luby see also:
http://porting.openoffice.org/servlets/ReadMsg?list=dev&msgId=1961840
Comment 1 tino.rachui 2005-10-12 20:12:51 UTC
target OOo3.0
Comment 2 tino.rachui 2005-10-13 07:45:15 UTC
dev notes
Comment 3 sardisson 2005-10-13 14:38:45 UTC
See also Patrick's posts in the thread at trinity beginning here:
http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&p=3952#3952

Currently this can only be done imperfectly--in fact, backwards--since OOo does
not provide enough information at save time.
Comment 4 Graham Perrin 2007-11-11 07:40:58 UTC
Adding a type code or creator code to a file will typically add a resource fork to a file. Resource forks are 
disliked in many circumstances. 

AFAIK: 

* type and creator codes are legacy

* it's preferable to use extended attributes. 
Comment 5 sardisson 2007-11-11 07:47:28 UTC
No, type and creator codes are HFS metadata (just like extended attributes on
10.5); they have absolutely nothing to do with resource forks.
Comment 6 eric.bachard 2007-11-11 08:11:33 UTC
Thanks for all explanations. 

Please don't fear to provide patches: they are welcome

Comment 7 eric.bachard 2007-11-11 08:13:05 UTC
Set keyword

imho, this issue must be fiwed for 3.0 
Comment 8 Graham Perrin 2007-11-11 10:11:53 UTC
sardisson: thanks for the clarification. Timely to remind myself about type code, creator code, filename 
suffix and resource fork ...
 
http://pastie.textmate.org/116495

ericb: much as I'd like to offer patches, I lack the skills. Sorry!
Comment 9 Martin Hollmichel 2008-08-29 11:06:45 UTC
set target 3.x
Comment 10 Martin Hollmichel 2008-08-29 11:11:57 UTC
set target 3.x
Comment 11 eric.bachard 2008-08-29 12:06:42 UTC
Can anybody on CC of the issue confirm whether it is 

- fixed 
- unfixed 

Tino ? 

Thanks  :-)

Comment 12 sardisson 2008-09-13 20:55:13 UTC
ÙThis remains unfixed in OOo 3.0rc1 on 10.5/Intel.  Saving a file and examining
it with an application[1] that supports viewing/editing type/creator codes
indicates that neither type code nor creator code is set (i.e., values are set
to ????).

[1] FileInfo, http://www.panix.com/~shopsinm/
Comment 13 eric.bachard 2008-09-13 22:17:26 UTC
If nobody disagrees, I'll have a look 
Comment 14 eric.bachard 2008-09-18 18:21:41 UTC
Created attachment 56618 [details]
creator as it should appear ?
Comment 15 eric.bachard 2008-09-18 18:24:52 UTC
Reassigning to me

@sardisson

That's what I have currently. Is it correct ?

In fact, we have a lot of creator types Apple registered, but we need to set them on the fly, what is not 
trivial (at least, I have no direct solution)

FYI, I have used just a little part of the patch, because most of it is obsolete, and only one parameter 
was set(two need to be set)


Comment 16 eric.bachard 2008-09-18 18:27:06 UTC
I'll take some time before the commit, to see whether the change has (probably positive) side effects

Started. Set target to 3.1 (I hope so .. )
Comment 17 sardisson 2008-09-18 20:02:56 UTC
> Created an attachment (id=56618)
> creator as it should appear ?

The Creator looks fine.

You don't want to be setting the Type on document files (like the creator007.odt
in the screenshot) to 'APPL'; that Type is reserved for applications.

If you can't set the right Type per document type (which is what I take "but we
need to set them on the fly, what is not trivial (at least, I have no direct
solution)" to mean, you should not set the Type at all, or use '????' as the
Type instead, and just set the Creator and fix only half of this bug.
Comment 18 eric.bachard 2008-09-18 20:23:25 UTC
@sardisson

Thanks for the comments. 

So, what type must be used ?  Looking at the list FileInfo does propose, I think there is no other choice, 
but I'm probably wrong. 

Other possibilities I found i n the documentation, are framework , bundle or .. I don't know. 
Got a better idea ?
Comment 19 Graham Perrin 2008-09-23 05:06:14 UTC
> you should not set the Type at all, or use '????' as the Type instead, and just set the Creator and fix 
only half of this bug.

Interesting. 

Focusing first on the type code:

Re http://developer.apple.com/faq/datatype.html 

> Apple no longer registers file types

and AFAIK no-one looks to any other registering authority. It is, to some extent, a free-for-all. Open :)

As the formats of ODF are specifically open, 
so the corresponding type code(s) may/should be open. 

As we use _established_ extensions to file names 
(.odp .ods .odt et cetera), 
with no plan for an additional establishment 
(no notion of .odtooo3 for example),
so we need not -- probably SHOULD not -- 
vary from an _established_ file type:

NO%F

----

Now, shift focus to creator code:

As NeoOffice does not distinguish its creations or editions, 
so OpenOffice.org need not distinguish its creations or editions. 
Use creator code:

????

Setting a creator code at any time may be misinterpreted, rarely, as somewhat proprietary. 

Keep it open. 

Allow the user to make their own decisions concerning file/application associations. Users will typically 
do so using Finder | File menu | Get Info | Open with: …

==========
Likelihood
==========

> many long-time Mac users save files without extensions, the Finder relies on the file's type or creator 
code to match extension-less files to an application.

Ultimately, the occurence of extension-less files should be rare. Especially with more modern 
applications and more modern versions of Mac OS X. 

Now, with apologies for use of uppercase:

IF OpenOffice.org 3 
defaults to saving a file with the appropriate extension to its name

AND IF OpenOffice.org 3 
defaults to hiding the extension at the time of naming

THEN we people need have little or no concern regarding type code or creator code.


IF the user strays from that default and 
AND IF the user opts to _omit_ the extension, 
THEN I suspect that the type and creator should be 
NO%F ????


ONLY IF you prefer to establish an ADDITIONAL type 
for the same open format (IMHO not a good idea) 
THEN my first thoughts would be: 

ODF?

and that might allow for a future family of types within the new establishment:

ODFP
ODFS
ODFT

but I do strongly suspect that it will be better to respect the open and established type code 

NO%F

Distinction -- if ever -- should be by creator.

Best regards
Graham
Comment 20 Graham Perrin 2008-09-23 05:10:52 UTC
Note to self, 

ADC Home > Reference Library > Guides > Cocoa > Design Guidelines > Document-Based Applications 
Overview > Saving HFS Type and Creator Codes

http://tinyurl.com/typecreator
Comment 21 Graham Perrin 2008-09-23 05:30:20 UTC
Without intending to stray from Bugzilla: I'm a long-time user of 
Diigo, and am likely to keep highlights and sticky notes at 
http://groups.diigo.com/groups/openoffice 
Comment 22 eric.bachard 2009-02-03 15:08:03 UTC
There is a demand, and I think this code is usefull.

@grahamperrin  : I'm sorry but I only care for OpenOffice.org
Comment 23 Martin Hollmichel 2009-04-17 15:03:58 UTC
any progress here, re-set target to 3.2 ?
Comment 24 thorsten.ziehm 2009-11-04 13:46:49 UTC
OOo 3.2 is in show-stopper stage. This issue is re-targeted to OOo 3.x. If this
issue is critical for the current release please target it back.
Comment 25 Marcus 2017-05-20 11:29:42 UTC
Reset assigne to the default "issues@openoffice.apache.org".