Author Topic: Windows directory equivalent of null?  (Read 965 times)

0 Members and 1 Guest are viewing this topic.

Offline daqqTopic starter

  • Super Contributor
  • ***
  • Posts: 2314
  • Country: sk
    • My site
Windows directory equivalent of null?
« on: January 23, 2023, 12:53:17 pm »
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
Believe it or not, pointy haired people do exist!
+++Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1226
  • Country: gb
Re: Windows directory equivalent of null?
« Reply #1 on: January 23, 2023, 04:11:10 pm »
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 ?
 

Offline JeremyC

  • Regular Contributor
  • *
  • Posts: 148
  • Country: us
Re: Windows directory equivalent of null?
« Reply #2 on: January 23, 2023, 04:55:32 pm »
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

I'm assuming you meant /dev/null in UNIX/Linux. In MS Windows/DOS equivalent of /dev/null is NUL (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: 1698172-0
« Last Edit: January 23, 2023, 05:02:51 pm by JeremyC »
 

Offline rdl

  • Super Contributor
  • ***
  • Posts: 3667
  • Country: us
Re: Windows directory equivalent of null?
« Reply #3 on: January 23, 2023, 05:17:25 pm »
Yeah, I'd just try write protecting whichever location you don't want it to write to and see how badly it fails.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15244
  • Country: fr
 

Offline mapleLC

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: Windows directory equivalent of null?
« Reply #5 on: February 28, 2023, 01:53:18 pm »
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.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1625
  • Country: ua
Re: Windows directory equivalent of null?
« Reply #6 on: February 28, 2023, 02:06:00 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf