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
4
votes
1 answer

Deleted file still reported as existing (Windows only)

(Note that this is not primarily a Qt question) It seems to me that the return value of QFile::exists() is sometimes incorrect. Consider the following two unit-test-like snippets (each of which I have executed a few thousand times in a loop) //…
simon
  • 273
  • 1
  • 7
4
votes
4 answers

Get name (not full path) of subdirectories in python

There are many posts on Stack Overflow that explain how to list all the subdirectories in a directory. However, all of these answers allow one to get the full path of each subdirectory, instead of just the name of the subdirectory. I have the…
Foobar
  • 7,458
  • 16
  • 81
  • 161
4
votes
1 answer

Interprocess in-memory filesystem in Python?

PyFilesystem (fs on pip) is a great library that supports in-memory filesystem creation with Python. However, I am looking to create and maintain a filesystem in Python in one process and dynamically access that filesystem in Python in another…
Matthew Mage
  • 395
  • 5
  • 18
4
votes
5 answers

disallow access to filesystem inside exec and eval in Python

I want to disallow access to file system from clients code, so I think I could overwrite open function env = { 'open': lambda *a: StringIO("you can't use open") } exec(open('user_code.py'), env) but I got this unqualified exec is not allowed in…
jcubic
  • 61,973
  • 54
  • 229
  • 402
4
votes
1 answer

Nodejs FS module returning no such file or dir error

Code: fs.readdir('./commands/', (err, files) => { // Do something... }); Error: ENOENT: no such file or directory, scandir './commands/' The folder ./commands/ does exist. This file is src/index.js and is trying to read the directory of…
user8500190
4
votes
4 answers

How do I count the number of files with a specific extension on Android?

In the app I'm developing for Android I'm letting users create files specific to my application with the extension ".rbc". So far I have been successful in creating, writing to, and reading from these files. Right now I am trying to count the number…
Rob S.
  • 3,599
  • 6
  • 30
  • 39
4
votes
0 answers

Do C++ and Python write to disk differently?

So, a few years ago I wrote a program in Python that writes the English names of a sequential list of numbers to a file (one, two, three, etc.). I have been working on getting a C++ version working off and on for the last month (personal project),…
IronEagle
  • 550
  • 7
  • 17
4
votes
1 answer

How to Download all Files listed in a directory from SFTP in laravel 5.6

I am new to laravel. I am making an application in which I check a directory that is being served on an SFTP. By looking into the documentation I was successfully able to list all the file names inside a directory hosted on that SFTP. My next goal…
umair.ashfr
  • 1,171
  • 13
  • 32
4
votes
3 answers

How to simulate INotify failure in functional test?

I have a Linux application that uses inotify for tracking filesystem changes. And I want to write a functional test suite for it that tests the application from the end-user perspective and as part of it I'd like to test situations where filesystem…
Gill Bates
  • 14,330
  • 23
  • 70
  • 138
4
votes
0 answers

How to handle special characters in directory and file names?

Below codes is used for tidy up current folder. import os, glob print "Tidy up ScreenShot ..." pwd = os.getcwd() for file in glob.glob("*.png"): #print file.encode('utf-8') file_time = file.split(" ") #print file_time[0] file_times…
Fisher
  • 376
  • 3
  • 14
4
votes
1 answer

Should a file be closed before removing?

I have a file pointer and I want to remove the file after loading the content of the file in a data structure. I'm not sure whether the file should be closed before removing. Which part of the code is correct? FILE* myFile = fopen("abc.bin",…
user4869409
4
votes
2 answers

How can I change atime and mtime of a symbolic link from Python?

I have a Python 2.7 program which must create a symbolic link with a modification date in the past. I can create the link with os.symlink(), and os.utime() claims to set the access time and modification time of files, but when I use os.utime() on my…
Jim DeLaHunt
  • 10,960
  • 3
  • 45
  • 74
4
votes
2 answers

Recursively re-spawn file on fsnotify Remove/Rename (Golang)

The Goal: I am attempting to monitor a file that is subject to being moved or deleted at any time. If and when it is, I'd like to re-generate this file so that an app can continue to write to it. Attempted: I have attempted to do this by…
gpanda
  • 785
  • 2
  • 10
  • 23
4
votes
0 answers

Can't read USN journal non-stop

My goal is to read write operations from a chosen drive (usually C), using USN journal. In the next code I've written, I made a small class that processes USN records by using DeviceIoControl with the FSCTL_QUERY_USN_JOURNAL and FSCTL_ENUM_USN_DATA…
David Haim
  • 25,446
  • 3
  • 44
  • 78
4
votes
1 answer

How can I use FileSystemWatcher from System.IO.Abstractions to monitor a mock filesystem?

I'm trying to create a class to monitor USB device arrivals and removals on Linux. On Linux, USB devices are represented as device files under /dev/bus/usb which are created/deleted in response to these events. It seems the best way to track these…
Tagc
  • 8,736
  • 7
  • 61
  • 114