Questions tagged [path]

The general form of a file or directory name that specifies a unique location in a file system. In many Linux and Unix-like OS the PATH (all upper case) variable specifies the directories where executable programs are searched for.

A path represents a unique file system location using the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent each directory. The delimiting character is most commonly a slash /, a backslash \, or a colon :.

A PATH (all upper case, ) in the Linux, UNIX-like operating systems and Windows contains list of directories, where the shell searches through, when a command is executed. The executables are stored in different directories in the OS. On UNIX-like OS the directories are separated by colon, on Windows by semi-colon.

Examples

Simple way to show the $PATH variable is:

echo "$PATH"
printf "%s\n" "$PATH"

A typical PATH looks like:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin

More generally, a path is a sequence of directions that, when followed in order, reach a certain object or location.

In addition to file system paths, there are paths through a tree:

root->left->right->right->left

or, again more generally, a set of attributes on an object.


There might be some other contexts where the term "path" is used to described something non-URI and non-directory related which are not covered by the general description.

One case would be in a context such as in the SCADA software, Ignition, where the term "path" is generally used to refer to tag-path - as Tag is the basic unit in the software, forming a hierarchical system like directory. Typical tag-path in Ignition look like this:

BaseFolder/MyTag

Or, more complexly when tag is not in the BaseFolder but referred from another "Parent" Tag:

BaseFolder/MyAdvanceUDTTag/MyBaseUDTTag/MyTag
19410 questions
210
votes
14 answers

C# Sanitize File Name

I recently have been moving a bunch of MP3s from various locations into a repository. I had been constructing the new file names using the ID3 tags (thanks, TagLib-Sharp!), and I noticed that I was getting a System.NotSupportedException: "The…
Jason Sundram
  • 12,225
  • 19
  • 71
  • 86
209
votes
26 answers

Access to the path is denied when saving image

I'm trying to save an image to a folder in .NET C# but I get this exception: Access to the path 'C:\inetpub\wwwroot\mysite\images\savehere' is denied.The error occured at mscorlib because at System.IO.__Error.WinIOError(Int32 errorCode, String…
Burjua
  • 12,506
  • 27
  • 80
  • 111
209
votes
8 answers

Where does Chrome store extensions?

I looked in: C:\Documents and Settings\username\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions for unpacked extensions, but that folder is empty for me. For newer versions, where does Chrome store the files?
204
votes
7 answers

How can I extract the folder path from file path in Python?

I would like to get just the folder path from the full path to a file. For example T:\Data\DBDesign\DBDesign_93_v141b.mdb and I would like to get just T:\Data\DBDesign (excluding the \DBDesign_93_v141b.mdb). I have tried something like…
Genspec
  • 2,279
  • 2
  • 14
  • 10
200
votes
4 answers

Find file name from full file path

Is there a way to extract the file name from the file full path (part of a file path) without the hassle of manipulating string? The equivalent in Java would be: File f = new File ("C:/some_dir/a") f.getName() //output a f.getFullAbsolutePath()…
defoo
  • 5,159
  • 11
  • 34
  • 39
198
votes
5 answers

What is the difference between user variables and system variables?

What is the difference between user variables such as PATH, TMP, etc. and system variables? I accidentally deleted the user variable PATH. What am I supposed to do?
rookie
  • 7,723
  • 15
  • 49
  • 59
194
votes
3 answers

fs.readFileSync is not file relative? Node.js

Suppose I have a file at the root of my project called file.xml. Suppose I have a test file in tests/ called "test.js" and it has const file = fs.readFileSync("../file.xml"); If I now run node ./tests/test.js from the root of my project it says…
Arman
  • 2,665
  • 3
  • 14
  • 19
194
votes
9 answers

How to check if a path is absolute path or relative path in a cross-platform way with Python?

UNIX absolute path starts with '/', whereas Windows starts with alphabet 'C:' or '\'. Does python have a standard function to check if a path is absolute or relative?
prosseek
  • 182,215
  • 215
  • 566
  • 871
188
votes
7 answers

Regex Last occurrence?

I'm trying to catch the last part after the last backslash I need the \Web_ERP_Assistant (with the \) My idea was : C:\Projects\Ensure_Solution\Assistance\App_WebReferences\Web_ERP_WebService\Web_ERP_Assistant \\.+?(?!\\) // I know there is…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
186
votes
17 answers

How to get a path to a resource in a Java JAR file

I am trying to get a path to a Resource but I have had no luck. This works (both in IDE and with the JAR) but this way I can't get a path to a file, only the file contents: ClassLoader classLoader =…
noripcord
  • 3,412
  • 5
  • 29
  • 26
185
votes
4 answers

How to add include path in Qt Creator?

I have a project I'm working on in Qt creator that requires a third-party library. I want to add the headers to the include path for the project. How do I do this?
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
184
votes
23 answers

How do I get the full path to a Perl script that is executing?

I have Perl script and need to determine the full path and filename of the script during execution. I discovered that depending on how you call the script $0 varies and sometimes contains the fullpath+filename and sometimes just filename. Because…
Chris Madden
  • 2,510
  • 2
  • 17
  • 11
181
votes
7 answers

Difference between forward slash (/) and backslash (\) in file path

I was wondering about the difference between \ and / in file paths. I have noticed that sometimes a path contains /and sometimes it is with \. It would be great if anyone can explain when to use \ and /.
Spider man
  • 3,224
  • 4
  • 30
  • 42
177
votes
6 answers

Passing two command parameters using a WPF binding

I have a command which I am executing from my XAML file using the following standard syntax:
JasonD
  • 7,472
  • 5
  • 31
  • 31
174
votes
3 answers

Finding the path of the program that will execute from the command line in Windows

Say I have a program X.EXE installed in folder c:\abcd\happy\ on the system. The folder is on the system path. Now suppose there is another program on the system that's also called X.EXE but is installed in folder c:\windows\. Is it possible to…
Zabba
  • 64,285
  • 47
  • 179
  • 207