Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Properties file wierdness



jschueler wrote:
| I have a java application that's being used by a few hundred people.  One
| mac user can't get the application to run.  On investigation, it seems
| that the java application cannot read a particular properties file.

What, specifically, do you mean "cannot read"? Usually, that means that your
program doesn't have read permission. If that's the case, all your
subsequent actions make no sense, since they have nothing to do with
checking or setting file permissions.


| I asked the user to email me the file.  The properties file is supposed to
| be ascii.  The file she emailed me is described as
|   Macintosh MacBinary data, type "    ", creator "    "
| and of course, contains binary header data.
| 
| I emailed her a clean copy of the properties file, she did a unix cat
| command, and it looks good.  Then she emailed me the file back, and once
| again, it had been reformatted with a binary header.

This tells me that her e-mail program isn't correctly packaging the file, or
that your e-mail program isn't correctly extracting the file. If the file
*itself* were mangled, "cat" would have produced garbage.


| The file name is properties.abc, in order to discourage users from
| tampering with the properties.

Users who will be discouraged by that won't know enough to make sense of a
normally-named .plist file either. Users who *do* know how to deal with
.plist files won't be discouraged by the extension. All you're really doing
is making things hard for yourself.


| As a test, I renamed the file  properties.txt, and this time, when she
| emailed it back to me, the file  was unchanged.

Which again implicates the e-mail programs, not the file itself. For you to
get valid data merely by renaming the file, the file *on her system* must be
intact.


| One final observation, when she attempts to open the file properties.abc
| on the mac, she gets an error "Not a valid QuickTime file".

How did she try to open it? If by using the "open" Terminal command (or by
double-clicking), this says only that, for whatever reason, ".abc" has
gotten flagged on her system as a QuickTime file. Since the file *isn't* a
QuickTime file, the message is completely reasonable.


| I know that Windows will change a file name to match the file format.
| Did the mac designers go overboard, so that the file contents change to
| match the name?

What leads you to conclude that the *file's* contents have changed? The only
actual *binary data* you describe is what your e-mail program gives you. The
only time the *file itself* was checked, by her running "cat", it contained
what it should contain.


What you describe sounds like nothing more sinister than her e-mail program
treating the file as containing binary data, and encoding it in MacBinary to
insure that it gets transmitted with all its (believed to be) binary data
intact. The non-standard extension is likely to be the cause of the problem:
the program probably assumes that any extension it doesn't recognize is
binary. (Alternatively, the program may have asked the OS what ".abc" files
are, and gotten "QuickTime file" back, again prompting transmission as
MacBinary.) Renaming would avoid the problem, because the e-mail program
would (correctly) guess that ".txt" identifies a text file. What happens if
you convert the received MacBinary data back to an ordinary file?


Glen Fisher

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Properties file wierdness (From: "jschueler" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.