Questions tagged [realpath]

The canonical path of the specified filename.

The canonical path of the specified filename, eliminating any symbolic links encountered in the path (if they are supported by the operating system)

127 questions
1
vote
1 answer

Capturing from Camera resulting in Failure delivering result ResultInfo

I am getting the following error: Failure delivering result ResultInfo{who=null, request=1888, result=-1, data=null} to activity After done taking picture with my camera. This is the code for onActivityResult @Override protected void…
Jeremy
  • 2,516
  • 8
  • 46
  • 80
1
vote
2 answers

PHP realpath not working to prevent directory traversal

I have received someone else's code for a system that shows folders with photos in them in your browser. For example, this is a possible url on the site: gallery.php?action=view&folder=Cars At the moment, you can replace "Cars" with…
yesman
  • 7,165
  • 15
  • 52
  • 117
1
vote
0 answers

Referencing js and css and getting Filenotfoundexception

the relative JS and CSS path mentioned in my JSP is not being picked up instead its giving some archive path from war file throwing file not found exception. could it be because of the entry in my weblogic.xml (version 12c ) …
NittinS
  • 53
  • 1
  • 9
1
vote
2 answers

Ignore a sub-directory in all situations (relative, absolute...)

I want to skip sub-directory $SKIP using find. What a pity this basic command does not work in all cases: find $DIR -path $SKIP -prune -o print Please help me improving the script skipit.sh: #!/bin/bash SKIP=$1 shift find "${@:-.}" -path "$SKIP"…
oHo
  • 51,447
  • 27
  • 165
  • 200
1
vote
1 answer

Why is realpath() only working with certain folders?

I am using PHP's realpath() function, and want to know why I get the following output: bool(false) string(48) "/var/www/vhosts/website.co.uk/httpdocs" bool(false) string(48) "/var/www/vhosts/website.co.uk/httpdocs" when running this…
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
1
vote
2 answers

traversing directories with php?

I have a path to a folder (e.g. /var/www/tester/assets/themes/default/css/). a user can provide a relative path to the folder, so for example. layout/ie7.css would give the path of /var/www/tester/assets/themes/default/css/layout/ie7.css. This works…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
0
votes
1 answer

Cannot get real path of some images on Android API 33

I have a strange situation and not sure how to debug further. I need to get the real path of a selected image from the gallery so I can upload it to a server via an API. It works perfectly that I can tell on a virtual Pixel 6 API 25, but fails on…
Joe
  • 1
  • 2
0
votes
1 answer

realpath throws undefined reference to realpath

Im trying to get the path of text file , when i use the method "realpath" & #include ,the compiler gives me an error message :"undefined reference to realpath"
Heba
  • 1
  • 3
0
votes
1 answer

C realpath return NULL vector, can't find the path

I wanted a function to return the absolute path given a relative path to an existing file. Searching online I came across realpath here: https://stackoverflow.com/a/229038/19637794 And followed the example here: Example of realpath function in C So…
0
votes
1 answer

How to read from a file when passing path as an argument using realpath()

I want to pass an argument of a specific file location using realpath() (example: /var/log/message) and by using fprintf print the content of this file on the terminal. This is the code I have so far: #include #include #include…
tuatara
  • 23
  • 3
0
votes
0 answers

PHP realpath function doesn't see (returns false) on the mounted directory in the arm64 docker service

I have two amazon EC2 instances with different CPU architectures. x86_64 ubuntu 20.04 arm64 ubuntu 22.04 Both are running the same docker service. However, each service is based on the corresponding CPU architecture docker image. I've mounted a…
0
votes
1 answer

bash get relative path from absoulte

This line gets absolute path, i used output to pass it to rsync, but rsync wants relative path find /www-data/ -type f -exec sh -c 'if ! lsof `readlink -f {}` > /dev/null; then echo `realpath {}`; fi' \; | tr '\n' '\0' No idea how to feed realpath…
overflowed
  • 1,095
  • 1
  • 18
  • 39
0
votes
0 answers

How can I make bash realpath work with variables?

I run #!/bin/bash id="~/.ssh/foo" realpath ~/.ssh/foo realpath "~/.ssh/foo" realpath $id realpath "$id" expecting 4 identical lines of output, with no errors. What I get is /home/me/.ssh/foo realpath: '~/.ssh/foo': No such file or…
spraff
  • 32,570
  • 22
  • 121
  • 229
0
votes
7 answers

Is RealPath safe?

Kraple
0
votes
0 answers

Getting error '/usr/bin/bash: line 1: realpath: command not found' when install JAX with CUDA

I am trying to build JAX with CUDA from source on my windows laptop. I have installed MSYS2. I am following the instructions given here However, I am unable to install realpath using pacman -S patch realpath as mentioned in the docs. I am getting…
Siladittya
  • 1,156
  • 2
  • 13
  • 41
1 2 3
8 9