Jump to content

CMD file cache?

After over a year exclusively using linux and many years of almost exclusively using linux I decided to give windows 10 a try to see how it is. Long story short, CMD appears to not see changes I am making to files. opening the same python file from CMD in notepad shows the correct file contents but if I run it, it still prints the old unedited message. if I open the file on the command line with the more command the file shows the old contents before my recent save as if it cached the file. this has persisted across a reboot.

 

Does anyone have any experience with this issue?

 

edit: I attached a screenshot to show an example. CMD on the left, notepad (launched from CMD to ensure that it was the same file) on the right.

why_windows_why.png

Link to comment
Share on other sites

Link to post
Share on other sites

CMD isn't terminal..

its not even something that can read python

 

it can do batch files. thats about it

Ryzen 5 3600 stock | 2x16GB C13 3200MHz (AFR) | GTX 760 (Sold the VII)| ASUS Prime X570-P | 6TB WD Gold (128MB Cache, 2017)

Samsung 850 EVO 240 GB 

138 is a good number.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Yep. CMD is pretty crap at... everything. 

 

Don't get me wrong, DOS is freaking amazing, but Windows, bit by bit, stripped out key features so that you would need a GUI to do some basic actions properly.

 

Also, what command did you use in CMD to get it to display the file?

Want to know which mobo to get?

Spoiler

Choose whatever you need. Any more, you're wasting your money. Any less, and you don't get the features you need.

 

Only you know what you need to do with your computer, so nobody's really qualified to answer this question except for you.

 

chEcK iNsidE sPoilEr fOr a tREat!

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, themctipers said:

CMD isn't terminal..

its not even something that can read python

 

it can do batch files. thats about it

CMD is not a linux shell but it is most definitely a terminal/command line. you can run python or any windows command from cmd, it just seems to use the wrong version of the file.

2 minutes ago, bob51zhang said:

Yep. CMD is pretty crap at... everything. 

 

Don't get me wrong, DOS is freaking amazing, but Windows, bit by bit, stripped out key features so that you would need a GUI to do some basic actions properly.

 

Also, what command did you use in CMD to get it to display the file?

I used 'more' which is a shitty version of less.

but just running "python myfile.py" prints out that it is using the default 20000, the file no longer has a single occurence of 20000 in it. i changed it, saved it and python/more still show it as 20000.

Link to comment
Share on other sites

Link to post
Share on other sites

I don't know what you are trying to do, but PowerShell is A LOT more powerful than Command Prompt. That is why it is now default.

If you want to Linux, you can. Windows 10 supports Linux subsystem (Bash). Meaning, it can run Linux based OS, natively, no emulation, nor translation or Virtual PC, and it does interact with Windows files. With a X-Windows Server software installed, you can even run and interact with a Linux GUI program.

 

What to do:

If you have Creators Update

  1. Start > Settings > Update & Security > For Developers. And Enable "Developer Mode" of Windows
  2. Go to Program & Features > Turn Windows feature on or off, and check the box "Turn Subsystem for Linux (Beta)", click OK, and restart
  3. Now in the start menu type: Bash, and pick Bash
  4. An quick install process of Ubuntu will take place.

 

If you have Fall Update of Creators Update (Coming out, estimated for October of this year)

  1. Go to Start > Settings > Apps > Program & Features > Program & Features > Turn Windows feature on or off, and check the box "Turn Subsystem for Linux (Beta)", click OK, and restart
  2. Go to the Store, and you can search/get: OpenSUSE, Ubuntu or Fedora (more distro coming. Any distro can add themselves to the Store)
  3. Open the OpenSUSE, Ubuntu or Fedora from the start menu, and bash away.

For X-Windows server from GUI support, install any GUI based Windows X-Server, like VxSvr, or MobaXterm, then under bash, set to export to display port 0 (export DISPLAY=:0), and run your executable.

 

All your Windows partitions are accessible from Bash, under the mnt folder.

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, SpaceNugget said:

I used 'more' which is a shitty version of less.

but just running "python myfile.py" prints out that it is using the default 20000, the file no longer has a single occurence of 20000 in it. i changed it, saved it and python/more still show it as 20000.

I mean, after taking a bit deeper look into this, why not use nano?

 

https://www.nano-editor.org/dist/win32-support/

 

Try that out; it should work because it's made to be a text editor from the command line.

Want to know which mobo to get?

Spoiler

Choose whatever you need. Any more, you're wasting your money. Any less, and you don't get the features you need.

 

Only you know what you need to do with your computer, so nobody's really qualified to answer this question except for you.

 

chEcK iNsidE sPoilEr fOr a tREat!

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, GoodBytes said:

I don't know what you are trying to do, but PowerShell is A LOT more powerful than Command Prompt. That is why it is now default.

If you want to Linux, you can. Windows 10 supports Linux subsystem (Bash). Meaning, it can run Linux based OS, natively, no emulation, nor translation or Virtual PC, and it does interact with Windows files. With a X-Windows Server software installed, you can even run and interact with a Linux GUI program.

 

What to do:

If you have Creators Update

  1. Start > Settings > Update & Security > For Developers. And Enable "Developer Mode" of Windows
  2. Go to Program & Features > Turn Windows feature on or off, and check the box "Turn Subsystem for Linux (Beta)", click OK, and restart
  3. Now in the start menu type: Bash, and pick Bash
  4. An quick install process of Ubuntu will take place.

 

If you have Fall Update of Creators Update (Coming out, estimated for October of this year)

  1. Go to Start > Settings > Apps > Program & Features > Program & Features > Turn Windows feature on or off, and check the box "Turn Subsystem for Linux (Beta)", click OK, and restart
  2. Go to the Store, and you can search/get: OpenSUSE, Ubuntu or Fedora (more distro coming. Any distro can add themselves to the Store)
  3. Open the OpenSUSE, Ubuntu or Fedora from the start menu, and bash away.

For X-Windows server from GUI support, install any GUI based Windows X-Server, like VxSvr, or MobaXterm, then under bash, set to export to display port 0 (export DISPLAY=:0), and run your executable.

 

All your Windows partitions are accessible from Bash, under the mnt folder.

Unfortunately the bash terminal doesn't have access to the GPU and I need cuda support to run my program. and for whatever reason, Microsoft's cutting edge neural network toolkit (I'm using CNTK) doesn't support powershell. https://docs.microsoft.com/en-us/cognitive-toolkit/setup-windows-binary-script

Quote

Start a standard windows command prompt, and run the installation script:

If you run the .bat from inside powershell it just says

Please execute this script from inside a regular Windows command prompt.

 

10 hours ago, bob51zhang said:

I mean, after taking a bit deeper look into this, why not use nano?

 

https://www.nano-editor.org/dist/win32-support/

 

Try that out; it should work because it's made to be a text editor from the command line.

I was just using more to see inside the file, the problem is that python itself sees the incorrect file contents. any gui based editor (I tried notepad, VScode, VS community) all see the correct file contents.

 

I have been making do by working in vscode and copy pasting the code to a jupyter notebook to execute for now but this is driving me bonkers.

Link to comment
Share on other sites

Link to post
Share on other sites

Interesting that It can't access the GPU, someone here showed that they use the 3D program Blender with it (o test the performance). Was running fine.

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, GoodBytes said:

Interesting that It can't access the GPU, someone here showed that they use the 3D program Blender with it (o test the performance). Was running fine.

https://github.com/Microsoft/BashOnWindows/issues/1788
 

points to this

 

https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/16108045-opencl-cuda-gpu-support

 

blender renderer uses cuda, they must have been using blender for windows or used it in cpu only mode.

 

I have scoured the internet all day and haven't found a single person with this issue. "more myfile.py" and "notepad myfile.py" on the same command prompt without switching directories shows two different files. python seems to be running the version that more sees. Some serious dark magic here.

 

Switching back to linux tomorrow.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×