How to get details like PHP's stat() but using (raw) FTP (CURL)?

Posted by Christian Sciberras on Stack Overflow See other posts from Stack Overflow or by Christian Sciberras
Published on 2010-04-19T09:11:48Z Indexed on 2010/04/19 9:13 UTC
Read the original article Hit count: 240

Filed under:
|
|
|
|

Hello all!

I'm new here. I've got a question related to PHP, FTP and CURL.

I need to emulate PHP's stat() with CURL FTP. I already know that it may take more than one command to do it. Here's what I've got so far (PHP/STAT ... FTP/CURL):

  • dev
  • ino
  • mode ... LIST *
  • nlink
  • uid ... LIST *
  • gid ... LIST *
  • rdev
  • size ... SIZE (or better still, use from LIST)
  • atime
  • mtime ... MDTM
  • ctime
  • blksize
  • blocks

*How is FTP LIST used and parsed (preferably on a single file)? What I need most are the values for atime and ctime, there rest is to be filled for the sake of having full functionality.

My end goal is to have a class for proper FTP access with streamWrapper functionality (so as to bypass allow_url_fopen).

Cheers!

© Stack Overflow or respective owner

Related posts about php

Related posts about stat