"No Such File or Directory"

Hi guys - I know a few old topics exist on this, and I've read through them. But in the interest of not necroing threads 3-5 years old I thought I'd make a quick new one.

I used to arduino/texas instruments/PIC a lot but I'm rusty. I'm writing a simple arduino code (mycode.ino) and I thought I'd move some defines and stuff into a separate header file. I opened a text window, named it mycode.h, and saved it IN the directory right next to my mycode.ino file. At the top of my program I included

#include "mycode.h"

However, I get the error "no such file or directory" when I try to compile. I'm not sure what I'm doing wrong. The file is definitely in the same folder as my .ino file. I have the filename right. It just isn't finding it. What am I doing wrong?

Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\phill\OneDrive\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10807 -build-path C:\Users\phill\AppData\Local\Temp\arduino_build_12179 -warnings=none -build-cache C:\Users\phill\AppData\Local\Temp\arduino_cache_412029 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\phill\OneDrive\Documents\Arduino\gantry_em\gantry_em.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\phill\OneDrive\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10807 -build-path C:\Users\phill\AppData\Local\Temp\arduino_build_12179 -warnings=none -build-cache C:\Users\phill\AppData\Local\Temp\arduino_cache_412029 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\phill\OneDrive\Documents\Arduino\gantry_em\gantry_em.ino
Using board 'mega' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\mega" "C:\\Users\\phill\\AppData\\Local\\Temp\\arduino_build_12179\\sketch\\gantry_em.ino.cpp" -o nul
gantry_em:3:23: error: gantry_em.h: No such file or directory

compilation terminated.

exit status 1
gantry_em.h: No such file or directory

You are missing the file "gantry_em.h". Show the contents of your "mycode.h".

There are two ways to include a file:

#include "some.h"

and

#include <some.h>

The difference is in the search path for the file. I never remember which to use when. When I’m sure the file exists where I expect it to be, but the compiler can’t find it, I simply try the other format.

Did you drink Microsoft’s KoolAid, and leave the absolutely stupid “Hide file extensions” check box checked?

As, stupid problem! I was digging at my .h file and realized that my computer was hiding the .txt file ending it was actually appending. When I turned on "show file extensions" I was able to remove that so it was actually solely "mycode.h" and not "mycode.h.txt" and now it works. Thanks! Mods feel free to delete.

Mods feel free to delete.

This will be left here, so others having the same problem will stop drinking the KoolAid.