Jump to content

A file extension is basically telling a program to open a set of 0's and 1's (or rather other symbols) in a certain way.

You can open really any sort of file in Notepad, you will just see a whole bunch of characters.

 

When you have a .PNG, .jpeg, .BMP, etc your computer just knows you probably want an image related program and the program can read out the file and create a picture on your screen 

 

The extension isnt anything more than an identifier for a file, so you can really simply add whatever you want as an extension to your file; creating your 'own' extension.

Then you just have to tell your PC what program to open said extension in. 

If Windows sees a lot of users using said files, they might end up assigning a default program too, but that is just speculation on my end.

 

 

What you might be looking for is how to create your own file system, as in a new PNG or txt format.

That goes a lot deeper though 

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046242
Share on other sites

Link to post
Share on other sites

it's nothing but a way to tell windows what software will be used to open it

 

osu! is a game that uses zip compression for their maps, but the extension is .osz

funny thing is you can actually zip the file, and change it to .osz and it'll work fine

you can also download a .osz file and change it to .zip and extract it to see what's inside

-sigh- feeling like I'm being too negative lately

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046270
Share on other sites

Link to post
Share on other sites

8 minutes ago, Wictorian said:

im not a programmer, but windows probably has a table somewhere that it refers to when you open a file type

and you can edit that table, to tell it what software to use when you see a certain file type.

 

as long as your extension name doesnt clash with anything in existent, shouldnt have any issues

-sigh- feeling like I'm being too negative lately

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046586
Share on other sites

Link to post
Share on other sites

19 minutes ago, Wictorian said:

Yeah guys come on. That's what I am talking about

If you really are asking about how to create your own file-format....well, that's entirely up to you. There is no rule on it or anything. Most file-formats typically have a header at the beginning of the file that describes any important information, like e.g. metadata about who created the file, at what time, the length of the data-section after the header, what type of compression the data-section uses -- if any --, and so on. Then, after the header would come the data and then often the last four bytes of the file would be a CRC32 or similar checksum so the software can check if the file has been corrupted or not.

 

That said, like I said, there is no reason you'd have to follow this scheme; it is entirely up to your own tastes and needs.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046607
Share on other sites

Link to post
Share on other sites

1 hour ago, Moonzy said:

im not a programmer, but windows probably has a table somewhere that it refers to when you open a file type

It does.

Settings -> Apps -> Default apps -> Choose default application by file type

 

 

 

4 hours ago, Wictorian said:

So how do they make file extension?

They just come up with a name and that's it. File extensions are literally just a name for a file, like .com is for a website. 

 

 

4 hours ago, Wictorian said:

How exactly do file extensions work?

When you open a file called for example "example.png" Windows looks at the .png extension, looks into a database and goes "okay, when there is a file ending with .png I open it with this program". That's literally all the functionality it has in Windows. It's a naming standard which lets your OS know which program to open a certain file with.

 

You can find all this info on Wikipedia:

https://en.wikipedia.org/wiki/Filename_extension

 

 

4 hours ago, Wictorian said:

And can one make their own extension?

Yes. You can just rename the file to whatever you want and you have made your own extension. 

In 5 seconds I just created my own file extension called "LAwLzIsBest".

Untitled.png.5b4605515abed69a9334a9c4c6a50cb3.png

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046726
Share on other sites

Link to post
Share on other sites

1 hour ago, Wictorian said:

Yeah guys come on. That's what I am talking about

 

@Moonzy

That is a completely different question. That question is "how do I create a file format".

That question however is about as vague as asking "how do I play a sport?".

 

Why do you want to create it?

What will it store?

What features do you need?

Do you have any experience whatsoever with whatever you're trying to achieve?

 

 

Here is an example of a format. This is Opus, an audio format. This document describes how it works and contains some sample code on how to make it work. The actual description of the format is over 150 pages long.

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046747
Share on other sites

Link to post
Share on other sites

37 minutes ago, LAwLz said:

That is a completely different question. That question is "how do I create a file format".

That question however is about as vague as asking "how do I play a sport?".

 

Why do you want to create it?

What will it store?

What features do you need?

Do you have any experience whatsoever with whatever you're trying to achieve?

 

 

Here is an example of a format. This is Opus, an audio format. This document describes how it works and contains some sample code on how to make it work. The actual description of the format is over 150 pages long.

I dont wanna create a file format, I am just curious.

I was asking about different aspects like compression. 

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046847
Share on other sites

Link to post
Share on other sites

21 minutes ago, Wictorian said:

I dont wanna create a file format, I am just curious.

I was asking about different aspects like compression. 

I see.

Well I think you're gonna need to narrow it down a bit more because compression is a massive topic by itself that caries from "it's quite simple" to "multiple companies are spending billions of dollars trying to engineer the best compression they can and it will take years upon years of education to understand their work". 

But compression is not even the only part of a file format. Here is the standard for ISOBMFF. It's the basis of what a lot of other formats such as MP4 and HEIF are based on. It's almost 250 pages long and that does not include any specifications for how the compression works.

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046918
Share on other sites

Link to post
Share on other sites

5 minutes ago, LAwLz said:

I see.

Well I think you're gonna need to narrow it down a bit more because compression is a massive topic by itself that caries from "it's quite simple" to "multiple companies are spending billions of dollars trying to engineer the best compression they can and it will take years upon years of education to understand their work". 

But compression is not even the only part of a file format. Here is the standard for ISOBMFF. It's the basis of what a lot of other formats such as MP4 and HEIF are based on. It's almost 250 pages long and that does not include any specifications for how the compression works.

Ok. I wanna know like how do they create file formats. Using some software? and what I mean by compression is how do they tell it to handle different things like compression.

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046937
Share on other sites

Link to post
Share on other sites

Go read Wikipedia on data compression and follow the links. The topic is huge and impossible to summarize on a forum thread...

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14046972
Share on other sites

Link to post
Share on other sites

51 minutes ago, Wictorian said:

and what I mean by compression is how do they tell it to handle different things like compression.

I think we've all been trying to give you some pointers and a suggestion that it's a very large topic, impossible to fully explain in a forum post.

Read up on some different formats and their features first, then start looking into how they are made, then look into how they compress data.

 

The algorithms behind data compression are huge topics.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14047104
Share on other sites

Link to post
Share on other sites

59 minutes ago, Wictorian said:

Ok. I wanna know like how do they create file formats.

What exactly do you mean when you say file formats? Do you mean compression algorithms or do you mean things like container formats? 

 

59 minutes ago, Wictorian said:

Using some software?

I am not sure how to answer that. I mean, I guess there is a program for creating formats. A lot of software is involved. Mainly Microsoft Word or some other rich text editor.

If you're asking for a program where you just click a few buttons and all of a sudden it poops out a well designed format standard then no. The format specifications are created "by hand" and the programs that conform to those specifications are written like any other program, using whichever programming language and framework the developers want.

 

 

59 minutes ago, Wictorian said:

and what I mean by compression is how do they tell it to handle different things like compression.

What do you mean?

Who are "they" in that sentence?

What do you mean by "handle"?

What are you referring to when you say "it"? The container? The program opening the file? The people writing the specifications?

 

 

 

Edit:

I think I got some resources for you that you will enjoy.

 

First, here is a fantastic video introduction to the basics of audio and video formats presented by Monty, the creator of the Vorbis audio codec, Ogg container and founder of Xiph. He has two videos that are both excellent. The first one is about compression and formats in general, both audio and video. The second video is specifically about how digital audio works.

A digital Media Primer for Geeks:

https://www.xiph.org/video/vid1.shtml

 

Digital Show & Tell:

https://www.xiph.org/video/vid2.shtml

 

 

If you want information about a specific video format then you're in luck! There is a good post about how HEVC works over at the doom9 forums, but it requires quite a bit of preexisting knowledge to understand.

https://forum.doom9.org/showthread.php?t=167081

 

Or this writeup about HEVC from IEEE: 

http://iphome.hhi.de/wiegand/assets/pdfs/2012_12_IEEE-HEVC-Overview.pdf

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14047120
Share on other sites

Link to post
Share on other sites

If you want to really understand how to create a file format, you probably need at least a masters degree in computer science. Its not somthing that is just done with software.. you have been given examples on just the tip of the iceberg being 150-250 pages long just to describe what a format does.. This is a topic that is not simple.. its not like, "How do I make a webpage" Which can be summed up as some very basic HTML code and be technically a webpage..

Link to comment
https://linustechtips.com/topic/1249822-file-extensions/#findComment-14047272
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×