rejetto forum

mtime

0 Members and 1 Guest are viewing this topic.

Offline pedrocarvalho

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
Hi!

thank you for your work with HFS!  i've set it up with password protection.

i can GET the files just fine, but i need to test the modification time of the file but i get an error whenever i try to call filemtime() from our own servers.

Code: [Select]
PHP Warning:  filemtime(): stat failed for ...
i'm calling it like this:
Code: [Select]
$srv_file = "http://$user:$password@[domain.com/file]";
//$srv_hash = md5_file($srv_file); // works
$srv_mtime = filemtime($srv_file); //doesn't work



any reason to fail? I've read through the menus, the FAQ and wiki, but i couldn't find any option related to this. Thank you for any help!


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 901
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
unless you have modified the template to execute cgi php(http://php.net/manual/en/install.unix.commandline.php) download: http://windows.php.net/qa/ , hfs doesn't nattily support php commands, which is why you are receiving the php error.

HFS is scripted in its own code with html code please see the wiki on HFS available scripting stuff:
http://www.rejetto.com/wiki/index.php?title=HFS:_scripting_commands

you will probably want the area via get:
time | A
returns current time information. The format is specified by optional parameter A. Refer to this page for format syntax. If A is not supplied, value "c" will be used.
Optional parameter when to specify a time other than current.
Optional parameter offset to specify the number of days differing from the current time.
« Last Edit: August 25, 2015, 06:36:16 PM by bmartino1 »
Files i try to keep and share can be found on my google drive:

https://drive.google.com/drive/folders/1FOWi3Gqaldld6JLXvZ-biDv4RSguf0IC


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
getting mtime of a remote file is very different than a local file.
For a start, i can see from the PHP documentation that it is supported only since version 5.
If you cannot make it work, in the comments you can find functions to do the job the hard way
http://php.net/manual/en/function.filemtime.php#73747