Questions tagged [readlink]
38 questions
7
votes
2 answers
Having trouble implementing a readlink() function
I've been trying to figure out a way to get some sort of ability to be able to return the true abspath of a symbolic link in Windows, under Python 2.7. (I cannot upgrade to 3.x, as most DCCs such as Maya/3ds max do not use that version of…

sonictk
- 178
- 2
- 10
4
votes
3 answers
C++ equivalent of 'readlink -f'
In unistd.h, I have the C function readlink, which follows a link down one target. The coreutil readlink has the great -f option to follow every sym link recursively. How can I get this behavior in C++? A boost library, a posix function I don't know…

pythonic metaphor
- 10,296
- 18
- 68
- 110
3
votes
3 answers
replacement for readlink() function in windows
readLink() is present in linux and is defined in unistd.h,is there any similar type function in windows please provide or else if we can make a function with similar functionality.I want to use the same functionality as readLink() please provide a…

Ankit Srivastava
- 35
- 1
- 10
3
votes
2 answers
readlink -f alternative in Linux 2.4
I have an java application.And I call some batch files from app.
A batch file get full path of itself by using readlink -f.
But I get "command not found error" in Linux.(Linux 2.4.18-3custom #2 Wed Aug 18 03:46:33 EDT 2004).
I tried pwd command in…

fatih emrah durum
- 71
- 4
2
votes
1 answer
How to obtain the full PATH, *allowing* for symbolic links
I have written bash scripts that accept a directory name as an argument. A single dot ('.') is a valid directory name, but I sometimes need to know where '.' is. The readlink and realpath commands provide a resolved path, which does not help…

jago
- 457
- 3
- 7
- 15
2
votes
1 answer
Is it possible to change the value of "/proc/self/exe" for an exec'ed child process?
I'm trying to use an exec system call to start another executable, but that executable is using readlink() on /proc/self/exe to determine its file location. I would like it to think that it has the same location as the parent executable, but it…

Ivanna
- 1,197
- 1
- 12
- 22
2
votes
0 answers
display information using the readlink of two files the same
function file_info($name) {
global $info ;
$info[0] = $name ; // the file name
$info[1] = filesize($name) ; // the filesize
$info[2] = filetype($name); // the filetype
$info[3] =…

Shiva Navaneeth
- 25
- 1
- 7
2
votes
0 answers
Determine Mac driver that is associated with a device when knowing major and minor numbers
Is there a way in Mac OS X that I can determine which device driver is associated with a particular device inside the /dev directory when device's major and minor numbers are known?
I have an FTDI device connected to my computer and need to know…

KoKa
- 797
- 1
- 14
- 31
1
vote
0 answers
proc/self/exe returns unwanted additional information, how to get rid of it?
I am using this snippet in my code to get the path of the current executable.
char buffer[PATH_MAX];
ssize_t count = readlink( "/proc/self/exe", buffer, PATH_MAX );
printf("buf: %s\n", buffer);
This works fine for the most part, and I have a…

monamona
- 1,195
- 2
- 17
- 43
1
vote
0 answers
Will linux readlink() syscall touch block device it refers to?
I have a question regarding linux (or POSIX) readlink syscall.
Will linux implementation of readlink() touch block device contained in "link" or will it only do IO on block device hosting the filesystem containing the link inode?

antun
- 51
- 3
1
vote
1 answer
Traversing multiple symbolic links recursively in Python
I want to write a recursive function to traverse symbolic links from source path to destination path
Example:
1)readlink patha/pathb/pathc -> gives if symbolic link exists
2)readlink patha/pathb/pathc/ -> gives if symbolic link exists
I'm using…

Somu
- 15
- 4
1
vote
2 answers
Why doesn't readlink return a null-terminated value?
Both The Single UNIX ® Specification, Version 2 (1997) and The Open Group Base Specifications Issue 6 (2004) require that readlink would not place a null-terminated value in buffer:
APPLICATION USAGE
Conforming applications should not assume that…

Yam Mesicka
- 6,243
- 7
- 45
- 64
1
vote
1 answer
readlink unable to take path names mentioned in a file
while
read -r line
do
readlink -f $line > a.txt
done < $1
I have a file which contains 30 symbolic destination pathnames passed by $1. I want to read this file line by line and wants to save ls results of each path in a…

Pompy
- 41
- 9
1
vote
1 answer
How to delete target of symbolic link in Gitlab CI script?
I have a problem setting up .gitlab-ci.yml file. I want to delete old commits, so I have only the latest and previous commit available on a (Debian) server.
For some reason, when the script is executed, it doesn't behave as expected - the commits…

WellBloud
- 927
- 4
- 13
- 29
1
vote
1 answer
Is there a way to configure vim to highlight syntax according to the extension of target rather then the link
I would like to know if there is some way to make vim always highlight according to the targets extension rather than the symlink's extension
I wrote a small shell function that can do what I want but it is not perfect.
Here is my…

I J
- 47
- 6