4
$\begingroup$

You are a programmer, you are on your way home from your boring work when suddenly a psychopath hits you on the head, kidnaps you and brings you to their secret den. You wake up in a dark room with only a laptop inside. You just located the door when you hear an electronically distorted voice: "Look at the laptop screen".

You look at the screen and you just see a file manager window; the opened folder have just one empty file inside:

window

The voice continues: "If you manage to create an empty folder the door will open and you will be free." So you think: "It's way too simple!". You left-click on the blank area, the contextual menu appears:

contextual-menu-folder

Here we are! The "create new..." menu item is disabled, so you cannot create new files or folders! But you know there are other methods to create a folder, after all you are a programmer, aren't you? Maybe You can just turn the file into a shell script with the right commands and execute it? You right-click on the file to see which text editors are installed:

contextual-menu-file

Here we go again! The psychopath disabled the "open" and "open with..." menu items too. Sure enough, the "create new...", "open" and "open with..." are disabled also in the "File" option of the toolbar; the other items in the contextual menus work, though. You try to open the application menu, but it does not work either. You start typing something furiously but wait... the keyboard does not even work! You also cannot navigate into a different folder. How can you create a folder and escape to the freedom?

Summary of the constraints and clarifications:

  • you cannot use the keyboard, only the mouse.
  • both mouse buttons work (left and right), but some contextual menu items are disabled.
  • all the other options work as expected.
  • there is a standard suite of pre-installed software in the laptop.
  • you cannot run any program from the application menu.
  • the file manager is showing a folder with an empty file inside (0 Bytes).
  • you cannot navigate in another location of the filesystem.
  • you cannot modify the content of the file.
  • the goal is to create an empty folder, the name of that folder does not matter.
  • the empty folder has to be created inside the given folder: emptying the given folder is not enough.
  • the screenshots are from Debian with the PCManFM file manager, but I'm pretty sure it also works with Ubuntu and other file managers (nautilus, nemo...). I'm not sure it works with other operating systems though.
$\endgroup$
5
  • $\begingroup$ Empty the trash can. It's a folder, right? $\endgroup$
    – Florian F
    May 19 at 21:30
  • $\begingroup$ @FlorianF no it is not $\endgroup$
    – melfnt
    May 20 at 9:45
  • $\begingroup$ For the close-voters: the question is fully defined and I don't see how the validity of any answer can be based upon opinion: if you want to proof that an answer is correct you can just try it in your file manager -- if it works, well, the answer is correct. There are a few correct answers rather than just one, that's true, but I don't see why this is a problem. $\endgroup$
    – melfnt
    May 20 at 20:07
  • $\begingroup$ So now this has been closed, are you going to tell us the answer you were thinking of? $\endgroup$
    – Vicky
    May 21 at 14:20
  • $\begingroup$ @Vicky no I think that would be considered as if we were ignoring the closing. I'm rather thinking a way to make the question more specific in order to limit the possible answers and then vote to reopen. I'll let you know in the next few days. $\endgroup$
    – melfnt
    May 22 at 12:55
5
$\begingroup$

Simplest I can think of is:

Open a new file explorer window, navigate to somewhere where there is already an empty folder, right click on it and choose copy, then click back to the original window and right click and paste. If there are no empty folders, copy a folder with stuff in it and then navigate into it and delete the contents by right click - Move to trash.

Alternatively:

You might be able to set the "Directory" bit through the file properties menu? I am not sure about this option.

$\endgroup$
3
  • $\begingroup$ Nice try! But: 1) you cannot navigate away from the opened folder. 2) there is no option to set the "directory" bit through the file properties menu $\endgroup$
    – melfnt
    May 19 at 16:22
  • $\begingroup$ I'm not navigating away from the opened folder - I'm opening a new file explorer window. If you really prefer I could probably right click and "copy" on one of the folders already in the left pane of the existing window. $\endgroup$
    – Vicky
    May 19 at 16:51
  • $\begingroup$ Which file manager lets you copy the Home/Downloads/Pictures/... folder in another folder? $\endgroup$
    – melfnt
    May 19 at 18:01
2
$\begingroup$

There is a little bit of ambiguity in the requirements. Is it sufficient to

delete that one file, thus making the folder it used to be in an empty folder?

A bit less cheatily,

it seems like we could drag-and-drop from one of the things in the left sidebar, which would either move or copy into the current folder, and then we could delete whatever's inside. (But if it moves rather than copying, then again this might not count as creating an empty folder?)

$\endgroup$
2
  • $\begingroup$ My thought exactly. rot13(Gurer vf n "zbir gb genfu" bcgvba va gur zrah. V thrff lbh pna nyfb qryrgr ol whfg qenttvat naq qebccvat gb gur genfu pna.) $\endgroup$
    – xhienne
    May 19 at 17:11
  • $\begingroup$ The first method is not valid, I'll fix the requirements. Regarding the second method: no file manager lets you copy/move the Home/Downloads/Pictures/... folder inside another folder $\endgroup$
    – melfnt
    May 19 at 18:03
1
$\begingroup$

Can't you just

Compress the file, which will create a zip file, which is technically a folder. Then, you can open that and delete the contents...

$\endgroup$
6
  • $\begingroup$ A rot13(mvc svyr) is not technically a folder: it is technically a file :D $\endgroup$
    – melfnt
    May 19 at 18:05
  • $\begingroup$ In certain environments, extracting a zip file with an empty file will convert it into an empty folder $\endgroup$ May 20 at 0:32
  • $\begingroup$ @MatthewJensen which environments are you referring to? I've never heard about that $\endgroup$
    – melfnt
    May 20 at 9:46
  • $\begingroup$ I tried it on Ubuntu and it worked. I'm not entirely sure why. My process is right-click file -> compress -> Create (as .zip) -> right-click file.zip -> extract here: new folder exists as "file (1)". Checking the contents of the .zip file shows that the type is unknown (no extension). $\endgroup$ May 20 at 21:14
  • $\begingroup$ I did some more experimenting, and it seems to only work when the unzipped folder needs to be renamed (from "file" to "file (1)"), and that somehow fails to preserve the empty file inside $\endgroup$ May 20 at 21:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.