Skip to main content

Questions tagged [file-system]

For challenges relating to manipulating and traversing the file system. This may include reading directory trees, creating, moving and deleting files or directories, reading or changing file permissions, etc.

1 vote
2 answers
224 views

Given a path to a directory, print a list of directories that need to exist in order to reach the directory specified in the path. Include the final pathname component, if applicable. This challenge ...
Explorer09's user avatar
17 votes
11 answers
1k views

Given a path to a file or a directory, detect whether the path can traverse to outside the current working directory, or attempt to traverse to the "parent directory" of the root directory. ...
Explorer09's user avatar
-10 votes
1 answer
571 views

Write code to generate a PDF file containing 6 bingo cards. Winner is the one that uses the shortest code and needs no actions except for installing a library and running the code. (No Save As PDF). ...
paki eng's user avatar
  • 175
8 votes
2 answers
237 views

On Unix-like systems, the ls command lists files. GNU's version of ls also colors them according to their properties and the ...
GammaFunction's user avatar
-1 votes
1 answer
152 views

Inspired by what I'm doing at work right now. Your program should take one parameter, the path to the file It should convert all the windows style newlines (\r\n) to unix style (\n) and write the ...
ToonAlfrink's user avatar
  • 1,334
1 vote
2 answers
453 views

Golf Me a Text Editor (similar challenges: Create a simple line editor and Line editor (more text here)) I seem to have forgotten which program to use to open, read, and write text files. Something ...
nope's user avatar
  • 131
2 votes
0 answers
266 views

Something unusual: a code golf question with a purpose. I occasionally find myself in scenarios resembling the following: Suppose you have two computers, A and B. Both of them have a fresh copy of ...
Erhannis's user avatar
  • 129
8 votes
14 answers
7k views

Requirement: Write a program (in any language) that counts the number of lines of code in files matching *.sh in the directory tree starting from the directory that ...
Aaron Esau's user avatar
3 votes
17 answers
948 views

Consider this file path: C:/Users/Martin/Desktop/BackupFiles/PC1/images/cars/new.png Your goal is to write a program that will return the file path starting from ...
Wais Kamal's user avatar
11 votes
14 answers
3k views

Your goal is to write a program or function that takes in as input a string representing the path to a file, and outputs a truthy value if that file is not empty and contains no non-null bytes -- i.e.,...
babou's user avatar
  • 259
19 votes
23 answers
3k views

At runtime, keep prompting for a line of input until the user input is not the name of an existing file or directory or other file system item, relative to the current working directory. Then return/...
Adám's user avatar
  • 31.9k
-2 votes
9 answers
293 views

Given a printable ASCII string representing a path to a file on a POSIX-compliant system, return just the filename, i.e. remove everything until and including the last slash (...
MBaas's user avatar
  • 113
11 votes
2 answers
628 views

This task is to output the shortest path to a file, after glob expansion. What is shell globbing? In most shells, you can use the * character in a path to ...
Pavel's user avatar
  • 9,497
-4 votes
4 answers
324 views

Background When you run tail -f file in bash, the file is outputted and then any subsequent appends. However, when you remove something that has already been ...
user avatar
12 votes
14 answers
3k views

Your task today will be to take an existing file and append zeros to it until it reaches a certain size. You must write a program or function which takes the name of a file in the current directory <...
Pavel's user avatar
  • 9,497

15 30 50 per page