php get free space of a removable media (eg. USB Flash Drive)

306 views Asked by At

Title says it all, I tried disk_free_space(), but it is not working for me. I guess it only returns "disk space" and not just any random media.

I have a script that would create another file in the removable drive, and a simple check for free space would definitely be helpful.

1

There are 1 answers

1
Dipak G. On BEST ANSWER

You can try diskfreespace() function. It returns the free space, in bytes, of the specified directory. This function is an alias of the disk_free_space() function.