FAQ Database Discussion Community


Referencing file from realpath PHP

php,ftp,relative-path,filepath,realpath
I have a class that handles FTP stuff located here: /var/www/html/crm/rhinos/classes/ftp.php This class is included in a script that generates a spreadsheet here: /var/www/html/crm/send_cust_lock.php The generated spreadsheet is located here: /var/www/html/crm/tmp/cust_lock_1430424215.xlsx My class contains the following method: public function put($filepath){ $fp = fopen($filepath, 'r'); $z = ftp_fput($this->connection, $filepath, $fp, FTP_BINARY);...

Confustion with realpath() buffer [duplicate]

c,linked-list,memset,realpath
This question already has an answer here: Unexpected behavior in printing a char array in C 1 answer Here's my function, which is looking for regular files in given directory, and then storing full path to them in a list. static my_func(const char *path, Files **list) //list - storage...

Why does realpath() return error EEXIST?

c++,error-handling,realpath
My program is running in a Linux environment, compiled with gcc version 4.4.7. I am using realpath() to "canonicalize" file paths. The path of every directory and file I feed to realpath() definitely exists, which of course is essential for realpath() to work properly. However, sometimes realpath() will fail with...

Issues with relative/absolute path

php,path,relative-path,realpath,pathinfo
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/ user_login.php applicant_track.php ucp/ index.php When...

Alternative to 'realpath' to resolve “../” and “./” in a path

c,canonicalization,realpath
realpath does what I need, but only works if the files in the path actually exist. I need a function which returns a normalized path from a string (e.g. ../some/./directory/a/b/c/../d to some/directory/a/b/d), regardless of whether the directories/files actually exist Essentially the equivalent to PathCanonicalize on windows. Does such a function...