arjdat Posted February 10, 2013 Share Posted February 10, 2013 hi i am an absolute newbie in this thing. i have a phpmyadmin table with columns name, date and time of copy. is it possible with php code that if a new file comes into a folder the code automatically inserts its name and the date and time of copy (not the creation or modification time, but the time it was copied in that folder) into my database table? i need the list to retain the names even if the file is moved from that folder or deleted. if a file with same name comes twice (after it was deleted) the entry should be twice. also a text log generation of the same listing would be great. many many thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/274286-database-of-files-in-folder-and-show-in-html/ Share on other sites More sharing options...
Zane Posted February 10, 2013 Share Posted February 10, 2013 It is possible, but doing so would require the editing of operating system files. You would have to append something to the OS functions for file traversing/copying/deleting/etc... that triggers a php script to execute as a command in the background. I myself have no idea where to even begin doing such a thing, but editing the OS files is definitely where you would sniff around.... and that could have hazardous effects if you do not know what you are doing. Surely there is some software out there that can keep up with your file modification actions so that you don't have to risk your OS. Quote Link to comment https://forums.phpfreaks.com/topic/274286-database-of-files-in-folder-and-show-in-html/#findComment-1411498 Share on other sites More sharing options...
trq Posted February 10, 2013 Share Posted February 10, 2013 Take a look at inotify and in particular incrond. See http://inotify.aiken.cz Quote Link to comment https://forums.phpfreaks.com/topic/274286-database-of-files-in-folder-and-show-in-html/#findComment-1411503 Share on other sites More sharing options...
Christian F. Posted February 10, 2013 Share Posted February 10, 2013 This depends upon the OS you're using, with Linux possibly being the easiest one to get something like this to work. In any case, you will need to involve other languages/tools than PHP, in order to be able to use dnotify or libnotify. this google search should provide you with all of the information you need, to set up a system like this. Quote Link to comment https://forums.phpfreaks.com/topic/274286-database-of-files-in-folder-and-show-in-html/#findComment-1411509 Share on other sites More sharing options...
arjdat Posted February 10, 2013 Author Share Posted February 10, 2013 thanks to all of you. since i am using windows i have to work with the power shell thing only and the standard applications available in the market were tried but did not serve us totally. Quote Link to comment https://forums.phpfreaks.com/topic/274286-database-of-files-in-folder-and-show-in-html/#findComment-1411533 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.