If I have managed to locate and verify the existence of a file using Server.MapPath and I now want to send the user directly to that file, what is the fastest way to convert that absolute path back into a relative web path?...
Are there any automatic methods for trimming a path string in .NET?
For example:
C:\Documents and Settings\nick\My Documents\Tests\demo data\demo data.emx
becomes
C:\Documents...\demo data.emx
It would be particularly cool if this were built into the Label class, and I seem to recall it is--can't find it though!
...
Hi, I added a custom install action to my installer to add one of my installation directories to the System PATH environment variable. After I run the installer, the PATH variable reflects the changes (when I access it through the Control Panel::System applet), but when I start a new command shell, the PATH variable does not reflect the ...
how does unix handle full path name with space and arguments ?
in windows we quote the path and add the commandline arguments after, how is it in unix ?
"c:\foo folder with space\foo.exe" -help
update:
i meant how do i recognise a path from the command line arguments.
...
Given a path such as
"mydir/myfile.txt"
How do I find the absolute filename relative to the current working directory in Python? E.g. on Windows, I might end up with:
"C:/example/cwd/mydir/myfile.txt"
...
Does anyone know of any good library that abstracts the problem of path manipulation in a nice way? I'd like to be able to combine and parse paths with arbitrary separators ('/' or ':' for example) without reinventing the wheel.
It's a shame that System.IO.Path isn't more reusable.
Thanks
...
I have an asp.net url path which is being generated in a web form, and is coming out something like "/foo/bar/../bar/path.aspx", and is coming out in the generated html like this too. It should be shortened to "/foo/bar/path.aspx".
Path.Combine didn't fix it. Is there a function to clean this path up?
...
Hey guys,
I'm trying to get IKVM to build (see this question) but now have encountered a problem not having to do with IKVM so I'm opening up a new question:
When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error:
ikvm-native-win32:
[c...
I have a core file generated on a remote system that I don't have direct access to. I also have local copies of the library files from the remote system, and the executable file for the crashing program.
I'd like to analyse this core dump in gdb.
For example:
gdb path/to/executable path/to/corefile
My libraries are in the current d...
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 the working directory can vary as well I can't think of a way to reliably get the fullpath...
I converted VS2006 vc++ project to VS2008. When compiling I get the above error. How do i fix it? am I missing this exe ?
...
How can I have a relative path in the web.config file. This value is not in the connection string so I cannot use |DataDirectory| (I think), so what can I do?
...
Suppose you have a full path to an accessible file or folder on the system. How can I get some kind of unique identifier for the physical device that the file (or folder) actually resides on?
My first attempt was to use System.IO.DriveInfo which depends on having a drive letter. But UNC paths and multiple network drives mapped to the ...
I have a managed DLL (written in C++/CLI) that contains a class used by a C# executable. In the constructor of the class, I need to get access to the full path of the executable referencing the DLL. In the actual app I know I can use the Application object to do this, but how can I do it from a managed DLL?
...
In python is it possible to get or set a logical directory (as opposed to an absolute one).
For example if I have:
/real/path/to/dir
and I have
/linked/path/to/dir
linked to the same directory.
using os.getcwd and os.chdir will always use the absolute path
>>> import os
>>> os.chdir('/linked/path/to/dir')
>>> print os.getcwd()
/...
Hello
How do you resolve an NT style device path, e.g. \Device\CdRom0, to is logical drive letter, e.g. G:\ ?
Edit: A Volume Name isn't the same as a Device Path so unfortunatly GetVolumePathNamesForVolumeName() won't work.
Thanks in advance.
...
I have a base URL :
http://my.server.com/folder/directory/sample
And a relative one :
../../other/path
How to get the absolute URL from this ? It's pretty straighforward using string manipulation, but I would like to do this in a secure way, using the Uri class or something similar.
It's for a standard a C# app, not an ASP.NET one...
What is the proper way to modify environment variables like PATH in OS X? I've looked on google a little bit and found 3 different files to edit:
/etc/paths
~/.profile
~/.tcshrc
I don't even have some of these, and I'm pretty sure that .tcshrc is wrong, since osx uses bash now. Anybody have any idea where these variables, especially...
It is typical to have something like this in your cshrc file for setting the path:
set path = ( . $otherpath $path )
but, the path gets duplicated when you source your cshrc file multiple times, how do you prevent the duplication?
EDIT:
This is one unclean way of doing it:
set localpaths = ( . $otherpaths )
echo ${path} | egrep -i "$...
What happens if I use HGetFolderPath api call in a 32 bit system with CSIDL_PROGRAM_FILESx86 folder id, instead of the CSIDL_PROGRAM_FILES id ?
Theoretically CSIDL_PROGRAM_FILESx86 should map to C:\program files (x86) in a 64 bit system but what does it map to in a 32 bit system where this path doesn't exists?
Thanks in advanced.
...