Questions tagged [readlink]

33 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
  • 158
  • 2
  • 10
4
votes
2 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
  • 9,476
  • 16
  • 59
  • 103
3
votes
2 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…
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,087
  • 1
  • 9
  • 19
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] =…
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
  • 647
  • 13
  • 24
2
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…
1
vote
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
  • 337
  • 2
  • 5
  • 14
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
  • 8
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
  • 653
  • 1
  • 10
  • 27
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
  • 65
  • 5
1
vote
0 answers

Condition on file descriptor

I have a kernel module that intercepts IOCTL system calls. Now as you now the IOCTL signature is like int ioctl(int fd, unsigned long request, ...); Now I want to have a condition on "fd", actually I want to do a special thing in my kernel module…
Cert
  • 79
  • 2
  • 9
1
vote
0 answers

How to get executable name from process id in C Linux

I am new to C Linux programming and for exercise I am trying to get executable name from process id. If I provide the process id myself then it works fine, but if process id is being provided dynamically in a while loop then the readlink returns -1.…
niko85
  • 143
  • 1
  • 10
1
vote
1 answer

Readlink not finding C files (MSYS)

A while back I asked a question about this subject and "solved" it by using Cygwin instead with its XWin utility, but I've come back to this issue again since the Xwin utility does not use my GPU and creates a severe bottleneck in simulations as a…
spacemoose
  • 11
  • 5
0
votes
0 answers

How to batch update all symlink pointers to replace "_F-ss" with empty string?

I am trying to replace all text file symlink pointers to replace _F-ss with empty string as below but running into below error, any guidance on how to fix this? find . -name "*.txt" -type l | xargs 'ln -nsf "$(readlink "%p" | sed…
wisecrack
  • 225
  • 1
  • 10
1
2 3