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
2
votes
4 answers

PHP autoload problem when running as a cronjob

I have the following file structure: cron.php /includes/functions.php /classes/ClassName.php corn.php includes functions.php calls new ClassName(). And functions.php contains the primitive autoloader: function __autoload($class_name) { …
user487772
  • 8,800
  • 5
  • 47
  • 72
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

realpath() in my env doesn't like NULL as second argument?

I'm on a linux box and /proc/self/exe does seem to be supported: ls -l /proc/self/exe shows that it's linked to /usr/bin/ls at the moment I run the command realpath /proc/self/exe prints out /usr/bin/realpath as expected both commands exit with…
user1011471
  • 1,090
  • 2
  • 14
  • 34
2
votes
3 answers

Issues with relative/absolute path

I've searched ways to do it so it would work but none of them seemed to work for all paths, so I was wondering if you could give me a direction on how to do this: This is the structure: Home Directoy config.php index.php includes/ …
Everett
  • 35
  • 4
2
votes
2 answers

Using listdir realpath abspath with symbolic links

Something that I don't understand : In a shell : mkdir -p /tmp/toto/titi/tutu touch /tmp/toto/tata ln -s /tmp/toto/tata /tmp/toto/titi/tutu/ python Then in python: import os zeList = os.listdir("/tmp/toto/titi/tutu/") print…
user3278877
  • 173
  • 4
  • 13
2
votes
3 answers

how to get Real Path from Uri?

I would like to upload file to server. So I use a file chooser. But I have a problem with some application to get the real path from uri. the case if the content is a v ideo, audio or image or if I can get the path directly i have no problem. the…
zied
  • 201
  • 3
  • 7
  • 17
2
votes
1 answer

Get realpath of uploaded file

I need to get the aboslute path of a file uploaded by the user in PHP. How can I do that? Im doing this cause I need to post the information to an API via cURL
David
  • 16,246
  • 34
  • 103
  • 162
2
votes
2 answers

Does PHP's realpath perform disk access

I belive that PHP's realpath function performs disk access since it needs to check the current directory. However, I would like to confirm that this is correct. So, Does PHP's realpath perform disk access? Ie. does it peform some sort of read/write…
pillarOfLight
  • 8,592
  • 15
  • 60
  • 90
2
votes
2 answers

casting issue with realpath function (c programming)

When I compile the following code: #define _POSIX_C_SOURCE 200112L #define _ISOC99_SOURCE #define __EXTENSIONS__ #include #include #include int main(int argc, char *argv[]) { char *symlinkpath = argv[1]; …
Ralph
  • 6,249
  • 7
  • 23
  • 19
2
votes
2 answers

PHP get absolute path without following symlinks

How do I get the absolute path to a file, without following symlinks. E.g. /path/to/some/file /path/to/some/link -> /path/to/some/file /path/to/some/directory/ My current working directory is /path/to/some/directory/ and I go realpath('../link) it…
Petah
  • 45,477
  • 28
  • 157
  • 213
2
votes
2 answers

java.io.FileNotFoundException when writing uploaded file to disk via getRealPath()

Glassfish seems to be adding extra to the path I want to save my image file too, is there some way to use only the absolute path my servlet gets with String appPath = request.getServletContext().getRealPath("");? I have spent days trying different…
chris loughnane
  • 2,648
  • 4
  • 33
  • 54
1
vote
1 answer

how to use bash variable with realpath command in a script?

realpath ~/test outputs /home//test. Now, I have to use this in my bash script, so I have the path stored in a variable. If I run the below commands in my shell it works. export REMOTE_DIR=~/test realpath $REMOTE_DIR I have following…
1
vote
2 answers

Unable to pick file (pdf, doc, docx) from download folder in Android 11 and above

I'm using the File Picker library. Permission code: if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R || Environment.isExternalStorageManager()) { //Toast.makeText(this, "We can access all files on external storage now",…
Ashwin H
  • 695
  • 7
  • 24
1
vote
2 answers

Error installing realpath on Mac running High Sierra

Trying to install on High Sierra: $ sudo /opt/local/bin/port install realpath ---> Fetching archive for realpath ---> Attempting to fetch realpath-1.0.1_1.darwin_17.x86_64.tbz2 from https://packages.macports.org/realpath ---> Attempting to fetch…
Larry Martell
  • 3,526
  • 6
  • 40
  • 76
1
vote
2 answers

Custom realpath() using regex

I want to create my personal realpath() function which uses regex and doesn't expect that file exists. What I did so far function my_realpath (string $path): string { if ($path[0] != '/') { $path = __DIR__.'/../../'.$path; } …
1 2
3
8 9