

Absolute paths fully specify a location: the file or directory can be uniquely identified regardless of the current location. Because of these differences, the fields of the Path class as well as the exact behavior of some members of the Path class are platform-dependent.Ī path can contain absolute or relative location information. The current platform also determines the set of characters used to separate the elements of a path, and the set of characters that cannot be used when specifying paths.

The format of a file name extension is platform-dependent for example, some systems limit extensions to three characters (such as FAT16 commonly used on smaller flash storage and older versions of ISO 9660 used on optical media), and others do not. On some systems, file paths can contain extensions, which indicate the type of information stored in the file. For example, on some systems, a path can start with a drive or volume letter, while this element is not present in other systems. The exact format of a path is determined by the current platform. A path does not necessarily point to a location on disk for example, a path might map to a location in memory or on a device. ' D:\Documents and Settings\cliffc\Local Settings\Temp\8\tmp3D.tmp is a file available for use.Ī path is a string that provides the location of a file or directory. ' D:\Documents and Settings\cliffc\Local Settings\Temp\8\ is the location for temporary files.
#Java get file path of current class full#
' The full path of temp is D:\Documents and Settings\cliffc\My Documents\Visual Studio 2005\Projects\ConsoleApplication2\ConsoleApplication2\bin\Debug\temp. ' The string temp contains no root information. ' This code produces output similar to the following: using namespace System Ĭonsole::WriteLine( " is a file available for use.", Path.GetTempFileName()) The following example demonstrates some of the main members of the Path class.
