Skip to main content
8 votes
Accepted

Why splitted text files is bigger than a large one with the same content?

Filesystem overhead. Every time you create a file, the filesystem reserves space on disk to store the file name, and other metadata like its permissions, creation date, etc. It also has to maintain a ...
chi's user avatar
  • 14.6k
7 votes

Typical file structure

First, let me state that you may have things to unlearn. Files that are a stream of bytes are very much the rule, and have been for a long time. Almost all filesystems store a sequence of bytes, and ...
Gilles 'SO- stop being evil''s user avatar
6 votes
Accepted

Is it possible to wear-level a FAT32 file system?

The OS references blocks using a "logical block address". The SD card then maps this to a physical page of flash memory. With wear leveling, each time data in that block is changed, it ...
D.W.'s user avatar
  • 162k
6 votes

What is a file?

According to Wikipedia, a computer file is simply a resource for storing information. The term appears to have originated in the punch card era, where a computer program was literally stored in a file ...
phyrfox's user avatar
  • 171
5 votes
Accepted

What type of an algorithm is being used for directory structure scanning?

For most file systems, a directory lists its entries in a certain order, so reading ("scanning") an individual directory will return its entries in that order. But when it comes to scanning whole ...
reinierpost's user avatar
  • 5,738
3 votes

How can I prove the file on DVD is the original?

There's no value in just owning the file of an NFT, that's why there are so many memes about right clicking JPEGs and saving them. Owning the smart contract is what really matters in the NFT world, so ...
mikinty's user avatar
  • 352
3 votes
Accepted

Linked allocation in operating systems: why not use a doubly linked list?

Singly and doubly linked lists have the identical (terrible) linear access time. Using doubly linked lists would not help performance. The only benefit you'd get is that reading file backwards is more ...
Simon's user avatar
  • 232
3 votes

SSD vs HDD Retrieval Time

TL;DR: You don't have to worry about seek times with SSDs like you do with hard disks. As a first-order approximation, you can think of them as random-access devices. SSDs let you read and write ...
D.W.'s user avatar
  • 162k
3 votes

Is it possible to wear-level a FAT32 file system?

When flash storage is exposed directly to the operating system, it's used with a file system specifically designed for flash, like JFFS2. USB and SATA flash drives emulate Winchester hard drives, and ...
benrg's user avatar
  • 2,157
3 votes

Why can't un-journaled filesystems be resized?

The "file allocation table" (which gives the FAT filesystem its name) is a fixed-size array "statically allocated at the time of formatting." Its size is determined by the size of the partition, ...
rici's user avatar
  • 12.1k
3 votes

What is the term for two file formats that describe the same amount of information?

I think that many programmers would look at it in terms of the conversions between the two formats, and say that each format can be converted to the other losslessly, and that it's possible to make a ...
hobbs's user avatar
  • 319
3 votes
Accepted

What's the directory structure on disk that keeps the information of all files?

Your intuition is mostly correct. I believe the description is not really sufficient. Directory entry should at least be able to allow the OS to be able to locate some parts the file on disk for I/O ...
sunnytheit's user avatar
3 votes

Why can't we mount multiple filesystem in same mountpoint?

SunOS 4.1 supported something like what I think you're getting at, called the Translucent File System. The idea is you could stack multiple filesystems in the same location. When searching for a file, ...
Pseudonym's user avatar
  • 22.3k
2 votes

What is a file?

I think of a file as a sequence of bytes. Even after it loses its name (usually caused by a call to rm, which unlinks it), it still exists on the disk until its chunks get overwritten by other stuff. ...
ncmathsadist's user avatar
2 votes
Accepted

Typical file structure

I've never heard of sequential files, but apparently the term can mean two things: Data which can only be accessed sequentially, for example the contents of a backup tape. Record-based files (what ...
Yuval Filmus's user avatar
2 votes

File systems and writing one

OEM Parameter block The OEM block not only stores data about the filesystem, it also contains information about the physical hard drive geometry, or about how files are laid out on your hard drive or ...
Tylon Foxx's user avatar
2 votes

File systems and writing one

The MBR refers to the format used by (many but not all, and slowly being replaced by GPT) disk to identity partitions. A partition is simply a contiguous range of blocks on the disk. A partition is ...
Amaury Pouly's user avatar
  • 1,181
2 votes
Accepted

No. of disk blocks writes required for writing the file

The correct answer is: greater or equal to K/D, depending on the fact that K can be a multiple of D or not. So, the answer is actually c), which differs from the other three answers. Note that if ...
Renzo's user avatar
  • 809
2 votes
Accepted

How pictures and videos are usually loaded in Memory?

Just having malicious instructions loaded into memory is not a problem in itself. Instructions (code) is just binary, so it might be stored in the data segment. Where it becomes a problem is if ...
D.W.'s user avatar
  • 162k
2 votes
Accepted

Why can't un-journaled filesystems be resized?

It’s just historical. Old file systems are not journaled, and they cannot be resized. At some point in time journaling was added, and at some point in two resizing was added. So new file systems ...
gnasher729's user avatar
  • 30.7k
2 votes
Accepted

Would this be the correct time complexity?

Since you have $n$ word, the put(k,v) operation needs to be done at least $n$ times. Let's say you have an algorithm that process $D$ in $o(n)$. The algorithm is ...
Pietro's user avatar
  • 316
2 votes

How can computers tell where the beginning and end of file/packet/frame headers are?

If you click on the link you provided you'll see that the word 802.1Q is itself a link and when you read that page you'll see that the field uses a special value, a magic number if you like for the ...
Robert Longson's user avatar
2 votes

Meaning of "untyped bytes" in file systems

They mean that the data is an array of bytes, nothing more. It does not come with any type information to indicate how the data should be interpreted. It is up to applications to figure out how to ...
D.W.'s user avatar
  • 162k
2 votes

Where is File Allocation Table in FAT32 file system stored?

The first five fields of the BPB (BIOS Parameter Block) in any FAT filesystem contains are following fields: The first three bytes are the boot jump; this contains ...
Pseudonym's user avatar
  • 22.3k
2 votes
Accepted

WAV file header: Why 2 bytes for channel?

The dry and somewhat unhelpful answer is: The creators of the WAV file specification deemed 65535 to be a reasonable maximum number of channels. Any reasonable surround sound system (3.1, 5.1, 7.1) ...
DirkT's user avatar
  • 991
1 vote

Where to learn about filesystem file placement strategies?

Filesystems are optimized to make very slow hard disks (uneven access times, getting nearby data is much faster) perform decently. A simple way of doing this is the original Unix file system. If that ...
vonbrand's user avatar
  • 14.1k
1 vote
Accepted

Why has Windows used NTFS for 20+ years, while many different systems have trendend in the linux community over the same time?

NTFS is pretty good. From the start it had journaling (unlike ext2), size limits large enough that they would never be an issue (unlike ext2/3), and a flexible design that allowed arbitrary attributes ...
benrg's user avatar
  • 2,157
1 vote

On what abstraction is a filesystem actually built on?

You usually have several layers. You will have a physical level, where complete sectors can be read or written - except on SSD drives, you can only write into an area that is zeroed, and you can only ...
gnasher729's user avatar
  • 30.7k
1 vote

Linked allocation in operating systems: why not use a doubly linked list?

The solution that is usually used is not to use a linked list. Most common is that the OS tries to allocate as many sequential blocks as possible, and record ranges of consecutive blocks. Often only ...
gnasher729's user avatar
  • 30.7k
1 vote
Accepted

Is a file a string of zeros and ones?

Yes the File has a binary representation and it can start with a leading zero. To verify this open any file from your computer with an hex editor and modify the leading hex to 00. You would most ...
jsbc's user avatar
  • 125

Only top scored, non community-wiki answers of a minimum length are eligible