I need to retrieve the absolute path of a file or directory "..\..\pippo.txt" to "c:\somedir\someotherdir\pippo.txt" somewhere in the standard C library may exist something i need. Thanks in advance
I need to retrieve the absolute path of a file or directory "..\..\pippo.txt" to "c:\somedir\someotherdir\pippo.txt" somewhere in the standard C library may exist something i need. Thanks in advance
Most likely there is but I don't understand exactly what you want. Please elaborate and be specific. Thanks. ~ JD
> Most likely there is but I don't understand exactly what you Directory structure: c:\somedir00 c:\somedir01 c:\somedir02 c:\somedir10 pippo.txt I've an ini file what describe the files contained in a project ROOTDIR="c:\somedir00\somedir01\somedir02" THEFILE0="..\..\somedir10\pippo.txt" When the program load the ini file, set the current directory to "c:\somedir00\somedir01\somedir02" with chdir() the file i've to load is "..\..\somedir10\pippo.txt" so in "c:\somedir0\somedir10\pippo.txt". I need a function that given the path "..\..\somedir10\pippo.txt" retrieve the full path "c:\somedir00\somedir10\pippo.txt". I've quite sure that the function exist but i can't remember it's name (SIGH!!!) Thanks
"PaoloItaly" < XXXX@XXXXX.COM > writes: Definately not in the standard library. You may have some success from the Boost.Filesystem library. (See the function named complete().) -- Chris (TeamB);
You'll have to build your own. If you were to manually do it using chdir(), you would change the directory every time that you encounter a backslash. For example, given "..\..\somedir10\pippo.txt" chdir( ".." ); chdir( ".." ); chdir( "somedir10" ); and you're there. ~ JD
Since this is the vcl forum, you can use the VCL function ExpandFileName which does that /Palle
Just add them: ROOTDIR + "\\" + THEFILE0 will give you: "c:\somedir00\somedir01\somedir02\..\..\somedir10\pippo.txt" Which is the same as: "c:\somedir0\somedir10\pippo.txt". Hans.
Perfect! and ExtractRelativePath does the rest of work... Thanks "Palle Meinert" < XXXX@XXXXX.COM > ha scritto nel messaggio
1.How to chage Absolute url to relative url ,and relative url to absolute url
How to chage Absolute url to relative url ,and relative url to absolute url
2.absolute path to relative path conversion
3.Generated files with attributes and absolute/relative paths
I have an attributed ATL project (call it B) that I am building with Microsoft Visual C++ .NET (55537-640-3684941- 18356). In the project I include the COM generated file A.h (from another ATL project A). The compiler interprets this and injects the command "import A.idl" into the idl for B. So far everything is okay. The problem is that when I build project B in debug, it references A.idl using the absolute path. When I build project B in release, it references A.idl using relative addressing. The case for release is a problem because I have other projects that want to include B.idl, but are in a different relative directory. My general question is if there is documentation on how the compiler decides to use relative or absolute paths for the files it inserts. Failing that, does anyone know why switching from debug build to release build would change the choice of absolute or relative paths? (I could find no project setting related to this issue.) Thanks for any input.
4.Absolute and relative paths in VC6 dsp files...
Hi, In VC6.0 when i insert an IDL file into my project from a folder that is different from my current project folder, i was expecting it to remember the name of the path as i inserted it. E.G. If my project is in c:\vcprojects\myapp\component1\component1.dsp and an IDL file is in c:\IDL\common.idl The .dsp file does a relative path include. The result looks like this in my DSP. "..\..\..\idl\common.idl". Is there any way to force the IDE to not do this and make it use only "\idl\common.idl". Hope i am clear..... Please let me know if you would like more information for understanding the problem. Thanks in advance for your time, V
5.There are any Path or Directory function to convert an absolute path to a relative path?
There are any Path or Directory function to convert an absolute path to a relative path using a choiced directory as base to calculate the origin of the relative path?
6. relative path setting for include directory path
7. Excel and C# absolute and relative address's
8. how to get files and folders path as per system location absolute path
Users browsing this forum: No registered users and 67 guest