All Questions
Tagged with file-system c
62 questions
2
votes
1
answer
129
views
ds (directory switcher): a *nix program for tagging directories with (short) tags and switching between them via tags
Repo
The complete program: GitHub repository
How it works
After you have cloned the above repository, change directory inside it and type make in order to compile ...
8
votes
1
answer
588
views
Shared-Memory Queue Implementation in C
Recently I am working on implementing a shared-memory based IPC message queue in C programming language on Linux system. A few design choices I've made include
The queue will have only 1 producer, ...
11
votes
6
answers
1k
views
fsize: A Command-Line Tool for Checking File Sizes
I have created a cross-platform CLI tool to quickly retrieve file size and present it to the user in different units of data. The whole program is written in C and for Windows Win32 API is used to ...
2
votes
3
answers
91
views
Read a helpfiles textfile or potentially delete one if given an argument that's in the list
I'm working on a MUD (multiplayer text game), and the helpfile system adds missing helpfiles (ones that are looked for but don't exist) in the following format, including the room number, character ...
6
votes
1
answer
193
views
Function for listing processes holding a specified file open
The function's prototype is:
int processes_using(const char *name, pid_t pidlist[], int size)
It searches through all processes it can to find any that have an ...
7
votes
3
answers
276
views
Copy a file portably across UNIX and UNIX-like systems with POSIX API (modeled after Boost's copy_file())
Overview:
Following the POSIX API, there are 2 versions of the function: unix_copy_file(), and unix_fcopy_file(). One works with ...
8
votes
2
answers
763
views
Wrappers around write() and read() and a function to copy file permissions
Below follows wrappers around read() and write() that retry when interrupted by a signal (the case where the return value is -1 ...
3
votes
2
answers
96
views
Finding the Size of a File in a Portable Manner (revision 2)
This is a follow up to Find the Size of a File in a Portable Manner (revision).
Changes made:
The return value of fseek() and ...
5
votes
2
answers
107
views
Find the Size of a File in a Portable Manner (revision)
This is a follow up to Find the Size of a File in a Portable Manner.
What's new:
The fast version (POSIX stat()) does not change the position indicator of the ...
4
votes
1
answer
234
views
Find the Size of a File in a Portable Manner
There's no function in the Standard C Library to determine the size of a file. The POSIX Standard has stat()/fstat() which are ...
12
votes
2
answers
1k
views
Header-only log-structured database
I'm seeking a code review for the ~2000 lines of code.
Makefile and tests are available at https://github.com/torrentg/logdb.
I would appreciate feedback on the following aspects:
Overall code ...
8
votes
4
answers
1k
views
3
votes
1
answer
61
views
Check if options are valid to create FAT12 image
This is a function that checks if a valid FAT12 image would be created. Since all the information to create it is available on the "boot sector", this is the parameter. I wanted the code to ...
13
votes
5
answers
3k
views
Portable old-school filesystem tool
I recently made a tool called mkfh to create a FHS compliant filesystem structure.
I aimed to make it as portable as possible, so I wrote it in C89 and also tried ...
2
votes
1
answer
315
views
Simple text file encryption and decryption
Short introduction; recently I've completed a basic course on C but other than that I have no programming experience and I am a total beginner.
As a practice project and to practice reading from and ...