Questions tagged [filesystems]

A file system is a way of organizing data on a computer system. Typically a file system consists of files, folders (normally a special kind of file) and an API that can be used for interacting with files.

File Systems (or filesystems)

A file system is the specification of how files in a computer should be logically stored, named and organized. File systems present to users a human-readable format of data organization in the computer, where each file is a discrete unit of data.

File systems present only a logical format. They don't necessarily reflect the way the data is physically stored on a computer disk drive, or other storage device. Since the computer actually stores data in bits, data on a storage device lacks any structure; consisting of nothing more than a series of 1s and 0s.

File systems therefore give structure and meaning to that data, by — at the very minimum — giving an arbitrary collection of bits a file name and maintaining a record of this file physical location on the storage device.

Common Elements

Other than file names, common file systems also describe and maintain directories and file attributes, which serve as a means to further structure data organization and to give files specific purposes, security features or functionality.

File systems usually store this information in table-like format in a specific region of the storage device. Each file is listed on this table with its location, length and other properties clearly declared. An operating system that understands the filesystem format can then read this table to access a file in order to edit, rename, delete, move or alter any of its attributes.

For more reading

File System, at Wikipedia

Various file system specifications

9576 questions
198
votes
8 answers

What is the difference between a directory and a folder?

Most people use the terms "folder" and "directory" interchangeably. From a programmer point of view, is there a difference, and if so, what is it? Does it depend on the OS, or is there a broad, general consensus? This contribution under English UI…
mafu
  • 31,798
  • 42
  • 154
  • 247
185
votes
3 answers

Notepad++ cached files location

On the most recent versions of Notepad++, when the application is closed, unsaved files are maintained when the application is restarted. I presume that those files are cached on a temporary files. What is the location of that file(s). Thank you
RedEagle
  • 4,418
  • 9
  • 41
  • 64
179
votes
27 answers

How do I check if a given string is a legal/valid file name under Windows?

I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename under Windows. I've tried…
tomash
  • 12,742
  • 15
  • 64
  • 81
178
votes
10 answers

How to copy a file from one directory to another using PHP?

Say I've got a file test.php in foo directory as well as bar. How can I replace bar/test.php with foo/test.php using PHP? I'm on Windows XP, a cross platform solution would be great but windows preferred.
Ali
  • 261,656
  • 265
  • 575
  • 769
176
votes
10 answers

How do you determine the ideal buffer size when using FileInputStream?

I have a method that creates a MessageDigest (a hash) from a file, and I need to do this to a lot of files (>= 100,000). How big should I make the buffer used to read from the files to maximize performance? Most everyone is familiar with the basic…
ARKBAN
  • 3,419
  • 4
  • 24
  • 22
176
votes
4 answers

Checking if a folder exists (and creating folders) in Qt, C++

In Qt, how do I check if a given folder exists in the current directory? If it doesn't exist, how do I then create an empty folder?
Switch
  • 5,126
  • 12
  • 34
  • 40
170
votes
18 answers

What is the best place for storing uploaded images, SQL database or disk file system?

I'm writing an application that allows users to upload images onto the server. I expect about 20 images per day all jpeg and probably not edited/resized. (This is another question, how to resize the images on the server side before storing. Maybe…
Tobias
  • 4,999
  • 7
  • 34
  • 40
168
votes
19 answers

How do you iterate through every file/directory recursively in standard C++?

How do you iterate through every file/directory recursively in standard C++?
robottobor
  • 11,595
  • 11
  • 39
  • 37
163
votes
12 answers

What character to use to put an item at the end of an alphabetic list?

I often prepend '_____' to the item I want in first position. Is there some sort of magical character I could use to put an item at the end of the list? Something more elegant than "z_item". Example of this issue for a list of files in Windows…
Kraz
  • 6,910
  • 6
  • 42
  • 70
161
votes
13 answers

How can I search sub-folders using glob.glob module?

I want to open a series of subfolders in a folder and find some text files and print some lines of the text files. I am using this: configfiles = glob.glob('C:/Users/sam/Desktop/file1/*.txt') But this cannot access the subfolders as well. Does…
UserYmY
  • 8,034
  • 17
  • 57
  • 71
154
votes
10 answers

GIT_DISCOVERY_ACROSS_FILESYSTEM not set

I have searched and read few post but my problem is not the same as described. So here's the issue: using git clone into folder under external partition of the disk works fine but all git commands fails. can't execute git status or git log... I…
user755
  • 2,521
  • 3
  • 18
  • 29
151
votes
11 answers

File system that uses tags rather than folders?

My files are a mess, I try to structure them into folders with names that describe what they are in a recursive class break-down sense but later on I have trouble finding the file again when I go looking for it (the one file can possibly exist in…
clinux
  • 2,984
  • 2
  • 23
  • 26
148
votes
12 answers

How do I programmatically change file permissions?

In Java, I'm dynamically creating a set of files and I'd like to change the file permissions on these files on a linux/unix file system. I'd like to be able to execute the Java equivalent of chmod. Is that possible Java 5? If so, how? I know in…
Roy Rico
  • 3,683
  • 6
  • 35
  • 36
140
votes
6 answers

Check whether a path is valid in Python without creating a file at the path's target

I have a path (including directory and file name). I need to test if the file-name is a valid, e.g. if the file-system will allow me to create a file with such a name. The file-name has some unicode characters in it. It's safe to assume the…
Fake Name
  • 5,556
  • 5
  • 44
  • 66
137
votes
8 answers

Determine file creation date in Java

There is another similar question to mine on StackOverflow (How to get creation date of a file in Java), but the answer isn't really there as the OP had a different need that could be solved via other mechanisms. I am trying to create a list of the…
Todd
  • 1,895
  • 4
  • 15
  • 18