Windows directory equivalent of null? - Page 1
Forum section: electronics / general

author: daqq
author_rank: Super Contributor
timestamp: January 23, 2023, 12:53:17 pm
content: Hello,I'm trying to trick a piece of software that creates a specific folder structure to not create certain folder - or at least create them somewhere where they can be ignored.The software in question can have the paths to the output directories for the individual blocks configured, but all of them are mandatory. So all of the outputs will be created, but to not clutter up the output directory (or at least not to have to manually remove the output) I would like to only have some of the output products there.Ideally I am thinking that I would set the output paths properly for the desired output products and set the output path for the not desired output as "TRASH" and it would create it directly in the trash folder. I can use the C:\$RECYCLE.BIN as the output, but I am not sure if that works regardless of the language variation/regional settings of the Windows in question.Is there any "%TRASH" "%NULL" directory I can use for this?Thanks,David

author: artag
author_rank: Super Contributor
timestamp: January 23, 2023, 04:11:10 pm
content: Is it possible to attempt to create them in a directory to which the user has no write permission ? Or will that cause it to error ?

author: JeremyC
author_rank: Regular Contributor
timestamp: January 23, 2023, 04:55:32 pm
content: Quote from: daqq on January 23, 2023, 12:53:17 pmI'm assuming you meant/dev/nullin UNIX/Linux. In MS Windows/DOS equivalent of /dev/null isNUL(just single L).I recall few years ago I was converting a Linux program written in C to Windows and I used gcc compiler. Replacing /dev/null with nul worked for me.Example:

author: rdl
author_rank: Super Contributor
timestamp: January 23, 2023, 05:17:25 pm
content: Yeah, I'd just try write protecting whichever location you don't want it to write to and see how badly it fails.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 23, 2023, 06:39:24 pm
content: https://stackoverflow.com/questions/313111/is-there-a-dev-null-on-windows

author: mapleLC
author_rank: Frequent Contributor
timestamp: February 28, 2023, 01:53:18 pm
content: Ugh.... every time I see NULL.Such a problematic programming concept to let loose. I have never seen it have any tangible benefits, but it sure fucks up a lot of stuff. Ok, you want to represent the fact your not assigning a value while being assigned as a value = NULL, which has a memory space address 0, which you cant access, the dear null pointer.How to represent logic, fuck it up, then everyone goes with it.

author: shapirus
author_rank: Super Contributor
timestamp: February 28, 2023, 02:06:00 pm
content: Neither of /dev/null and NUL are suitable to be used for directories.What you are asking about is normally done by creating a unique temporary directory using a standard C library mktemp() call (man 3 mktemp) or a utility serving as a user-callable wrapper around it (man 1 mktemp), and removing it after the work is done. This works in POSIX-compatible systems. I'm not sure if there is such a call/tool in the Windows world.