473,657 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can we find the full path to a directory?

1 New Member
Hi,

I have a piece of code which finds the symbolic links in a directory structure and then use the function readlink() to get the actual path of symbolic link.

e.g.: i get symbolic link /home/software/myproject/bin which points to /home/software/myproject/bin-1.0

Now there are 2 problems, readlink() returns me either the full path as metioned (/home/software/myproject/bin-1.0) or it just gives me back bin-1.0 (link could be created only on folder bin-1.0 using command prompt).

My problem is that i want always the full path. Please let me know how can i find the full path after readlink() gives me the directory name only.

Is there a way i can find the full path from just directory name?

Regards,
Jay
Jun 24 '10 #1
0 1198

Sign in to post your reply or Sign up for a free account.

Similar topics

3
12373
by: Xah Lee | last post by:
Split File Fullpath Into Parts Xah Lee, 20051016 Often, we are given a file fullpath and we need to split it into the directory name and file name. The file name is often split into a core part and a extension part. For example: '/Users/t/web/perl-python/I_Love_You.html' becomes
1
4598
by: Raquel | last post by:
Ok, so these are the two pieces of information regarding the location of archived logs during a rollforward recovery in a recoverable database: 1. OVERFLOWLOGPATH configuration parameter can specify a location for DB2 to find log files that are needed for rollforward operations. 2. The database configuration file parameter 'userexit' specifies whether the database manager invokes a user exit program to retrieve log files during...
3
25653
by: PHaroZ | last post by:
Hi, I want to retrieve the complete full path to the directory of my current page but i don't find how to do that. For example i want : D:\myWebSite\firstDotNetWebApp\dir1\ I tried "AppDomain.CurrentDomain.BaseDirectory" but it's return only the path to my WebApplication, ex : D:\myWebSite\firstDotNetWebApp\
3
1540
by: kd | last post by:
Hi All, Given a full path name of a file, is there a command to extract the directory path (without the file name)? Thanks. kd
7
5072
by: gmax2006 | last post by:
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys
7
2885
by: Mike OKC | last post by:
The Directory.GetFiles method will bring back the file name including the path. I just want the file name, not the path. For Each strFile In Directory.GetFiles(strLocalPath) Me.lstLocal.Items.Add(strFile.ToString) Next
11
8280
by: rh00667 | last post by:
hi all, i'm confused now. how i can get the full path of an application? if myapp is in a directory which belongs to PATH, argv gives me the first token of cmd line, and not the real path of the executed program. so if i write anywhere:
27
2074
by: kvnsmnsn | last post by:
I've written a piece of code that interfaces with Postgres. It needs to write a Postgres table to disk, which it does with the <COPYcom- mand. That command requires the absolute file name of the file being written to. Right now I've got it hard coded to the exact location where I want it, but that's not very portable. Is there some way in C to retrieve the absolute path name of the current directory, so that I could use that in my code...
4
3020
by: somank.sharma | last post by:
I am running an exe created in C. I need the full path (absolute path) of this exe. In the first argument of main, I am getting the exe name. How can I get the full path for this exe.
4
2833
by: Michel Rouzic | last post by:
I made a program that accepts as parameters an input file name that we'll call file1, and an output file name that we'll call file2, and opens on its own a configuration file called file3. My program works correctly when calling it like this : ./program file1 file2, and also with full paths, like this : ./program c:\dir\file1 c:\dir\file2 However, a most puzzling phenomenon occurs when I use the full path only for the first file, like...
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8622
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.