Win a copy of Kotlin Cookbook this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

File names ending .txt

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have had this problem too
i did everything i can
but no return

turns out it was the file extension .txt
i didn't cancel its hidden status
 
Marshal
Posts: 67050
255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have created a new threa‍d because you had your post on somebody else't thread. The correct solution to that problem is, don't use MS NotePad. Use a different text eeditor; when I used Windows®, my favourite was NotePad++, which is totally unrelated to the MS tool with a similar name.
 
Ranch Foreman
Posts: 91
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch

I have created a new threa‍d because you had your post on somebody else't thread. The correct solution to that problem is, don't use MS NotePad. Use a different text eeditor; when I used Windows®, my favourite was NotePad++, which is totally unrelated to the MS tool with a similar name.


Sadly the context gone complete missing by your action. Neither the new topic title nor the split text gives a clue to what TO is referencing about. Might it's be possible to quote in the original lines of text TO is might reply to?
 
Campbell Ritchie
Marshal
Posts: 67050
255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was a different, unrelated problem, but this is where the post was removed from.
 
Saloon Keeper
Posts: 21478
144
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow. Non Sequitur. I had to re-read this thread 4 times and the original link twice (Thanks for providing that, Campbell!)

After all that, I've deduced that Szu Cheng was having a problem seeing a ".txt" file in the Windows File Explorer because the "hide file extensions" option was enabled, making it look like another file with the same name but different extension.
 
Campbell Ritchie
Marshal
Posts: 67050
255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But you only get that problem if you use MS NotePad to edit your Java® code, because it adds the .txt extension automatically. Other text editors don't do that.
 
Tim Holloway
Saloon Keeper
Posts: 21478
144
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:But you only get that problem if you use MS NotePad to edit your Java® code, because it adds the .txt extension automatically. Other text editors don't do that.



Actually, most GUI applications do add an extension when doing an initial save. Most of the exceptions are old Unix programs, I think. But many apps can save in more than one format, so, if for example Notepad+ defaults to ".doc" format, and you want a ".txt" format file, you have to explicitly tell it.

And then, of course, there are the extended forms where instead of doing a simple "save", you have to "export". Like for example, getting a PDF document out of a word processor.
 
Campbell Ritchie
Marshal
Posts: 67050
255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I see what you mean, but NP defaults to a .txt extension unless you do something strange like SaveAs→"MyClass.java" with quotes on. As you said, other apps let you find out about extensions in advance.
 
Tim Holloway
Saloon Keeper
Posts: 21478
144
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote: other apps let you find out about extensions in advance.



Some do, some don't. Like I said, this is especially common in Unix/Linux GUI apps where the default may be no extension at all, even though the app does have a preferred extension.

On saving ".java" files from a text editor, though, that brings up another matter. Conventionally, apps will save in their "native" format and automatically add the standard extension for that format, but (usually) allow you to override or even nullify the default file extension. Then there are the apps that save in multiple formats, and choose the data format based on what extension you assign. And finally, there are apps that support multiple formats and have an extra option of the Save File dialog that allow you to save in a format that's in direct conflict with the normal format/extension conventions. There are 2 or 3 of those I use regularly, in fact.
 
Do not threaten THIS beaver! Not even with this tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!