I have this to find the path:

System.IO.FileInfo path = new FileInfo(com.Substring(5));
                        string fullpath = path.FullName;

But that returns the path of the console app + whatever i type.
(e.g. C:\users\RILEY\Desktop\....\....\....\+(com.substring(5)))
What I want to happen is when i enter:

./$ cat log.txt

The console app writes what is in the text file. i can read and display it but i dont want me or my users to to have to write:

C:\(Ungodly long f***ing file path)\(another ungodly long f***ing filepath)\(another ungodly long f***ing filepath)\(another ungodly long f***ing filepath)\(another ungodly long f***ing filepath)\(another ungodly long f***ing filepath)\(another ungodly long f***ing filepath)\(another ungodly long f***ing filepath)\(whatever text file you want to read)

So how do i just type a file name and have it get the full path of it?

Recommended Answers

All 5 Replies

cat is a Linux, Unix, MSDOS? command. I seem to remember from the old days there exists a $PATH variable you can set.
But I don't know what this has got to do with C# and .NET.
I let my users choose from an Open file dialog, with a few mouse clicks they walk over all their hard disks and choose the file they like. This is the 21st century.
BTW with your attitude of being lazy and getting frustrated because you have to type too much, you are not going to bring it far as a programmer. Better go fishing, or start nitting.

cat is a Linux, Unix, MSDOS? command. I seem to remember from the old days there exists a $PATH variable you can set.
But I don't know what this has got to do with C# and .NET.
I let my users choose from an Open file dialog, with a few mouse clicks they walk over all their hard disks and choose the file they like. This is the 21st century.
BTW with your attitude of being lazy and getting frustrated because you have to type too much, you are not going to bring it far as a programmer. Better go fishing, or start nitting.

I just want it to be user friendly. and writing a paragraph every time you want to open a file is silly when it is not necessary. Yes it is is a linux command but i am making my own commands. Surely it is possible to find a file path with a given file name.

For lazy's eyes only: get working directory

That seems as though i wouldnt give me the file path of...but I can use parts of it to change to the path and then open the file. I ll add that command. Thanks for the help

Have you tried a Long Path Tool? I'm having the same type of problem and it is freaking annoying. I just want a quick fix coz I'm not that tech or computer savvy. Any ideas with pathtoodeep.com's Long Path Tool?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.