View Single Post
  #35  
Old December 14th 17, 03:39 PM posted to comp.sys.mac.apps,alt.windows7.general,comp.sys.mac.system
nospam
external usenet poster
 
Posts: 4,718
Default Can a Macintosh person tell us how to change the name of a file?

In article , Mayayana
wrote:


| The type of a file and which app you'd like it to open with are items
| of file metadata and have no business being part of the filename.

| Many files have such type-identifiers included. E.g., a JPG file begins
| with JFIF, a WordPerfect file includes WPC in the first line, an MS .doc

| Then you've put the metadata inside the file, which is even worse. It
| should be part of the file system.

This is the problem with mixing Mac and Windows
discussions. As I understand it, Mac stores file data
separately as a "resource fork".


as usual, you understand wrong.

classic mac os had both a data *and* resource fork *and* file system
metadata.

the actual file contents is in the data fork, with the resource fork
being a miniature database of other stuff, such as fonts, window
position, colour palettes, etc.

a given file might have only a data fork, only a resource fork or both,
depending on the purpose of the file.

microsoft copied the idea, adding multiple forks to ntfs, known as
alternate data streams.

Mac users are not
expected to understand anything about files. That's
not the same as metadata.


also wrong. very wrong.

Resource fork used to be a problem when Mac users
emailed photos. If they didn't know to strip the Mac-
specific prepended data they'd send a corrupt file.


it was never a problem nor is there any prepended data.

clearly it's *you* who doesn't understand anything about files.

File signatu Sometimes called "magic" or "magic
bytes" -- beginning bytes that *sometimes* identify
a file type. For instance, a BMP bitmap file starts with
hex 42 4D, which in ASCII encoding is "BM". A TXT text
file, on the other hand, usually won't have any header
at all. It *might* have a marker if it's unicode-encoded.

File headers are data about the file structure, appearing
at the beginning of the file. Headers, or lack of them, vary
widely with file types. BMP header is very simple. TXT has
none. JPG can be extensive, even including a small
thumbnail image. There's no rule about the need for
headers and even when there are headers the rules are
sometimes flexible.

Metadata: Optional file info stored in a file header. Some
of it is standard to the file format. Some is added. For
example, everyone and his brother has made up data
markers to store in JPG files. None of it has to be there.
Some of it is unofficial and not widely supported. It's
been established willy nilly as JPG has become widely used.

On the other hand, the file header of PE files (portable
executable EXE, DLL, OCX) is strictly defined to detail
things like imported dependencies, exported functions,
embedded strings and other resources, etc.

You don't need to "open" a file to see what type it is, in
the sense that you don't have to run it.


but you do have to open the file and read the info in the header,
making it a costly operation just to find out what type of file it is.

The hex editor
HxD is free and very good. You can put an Open With HxD
on your right-click menu and look at the file bytes to
see what it is.


you're going to do that for every single file?
Ads