autoitquestion Posted April 28, 2011 Share Posted April 28, 2011 Hi, How can I read the last modified file name in given path? And how can I get all file names of given path Thanks a lot ahead! Noa :-) Link to comment Share on other sites More sharing options...
hannes08 Posted April 28, 2011 Share Posted April 28, 2011 (edited) hi autoitquestion, _FileListToArray => lists all files of a given ath to an array FileGetTime => Returns time and date information of a file. Edit: Maybe you want to use the search functions in the helpfile and the forum first before posting questions. No offend, but I think these things can be found easily by searching. Edited April 28, 2011 by Hannes123 Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
autoitquestion Posted April 28, 2011 Author Share Posted April 28, 2011 (edited) So I search myself in manual and eventually I try search for file name begin with getName_ in path: C:\temp. I did as below: $search = FileFindFirstFile("C:\temp\getName_") If $search = -1 Then ConsoleWrite("search failed") Else ConsoleWrite("search passed") EndIf file exist and it print search failed What could be the reason? Edited April 28, 2011 by autoitquestion Link to comment Share on other sites More sharing options...
Developers Jos Posted April 28, 2011 Developers Share Posted April 28, 2011 So I search myself in manual and eventually I try search for file name begin with getName_ in path: C:\temp. I did as below: $search = FileFindFirstFile("C:\temp\getName_") If $search = -1 Then ConsoleWrite("search failed") Else ConsoleWrite("search passed") EndIf file exist and it print search failed What could be the reason? What do you think the issue could be? Read the helpfile .... think a little .. then answer. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 28, 2011 Moderators Share Posted April 28, 2011 You need a wildcard "*" eg. FileFindFirstFile(@TempDir & "\getName_*") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
hannes08 Posted April 28, 2011 Share Posted April 28, 2011 If you take a look at the manual you'll see something like this:Function: FileFindFirstFileParametersfilename: File search string. (* and ? wildcards accepted) ==> You'll need to use wildcards! Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Developers Jos Posted April 28, 2011 Developers Share Posted April 28, 2011 Spoilsports SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
hannes08 Posted April 28, 2011 Share Posted April 28, 2011 Spoilsports Do you think we can make independent replys 4 in a minute next time? Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
autoitquestion Posted April 28, 2011 Author Share Posted April 28, 2011 So... First of all-thanks to all! Second: My solution is: $search = FileFindFirstFile("C:\temp\*getName_*") If $search = -1 Then ConsoleWrite("search failed") Else ConsoleWrite("search passed") ;in $value we'll get file name $value= FileFindNextFile($search) EndIf Link to comment Share on other sites More sharing options...
Developers Jos Posted April 28, 2011 Developers Share Posted April 28, 2011 So...First of all-thanks to all!Second:My solution is:Ok... this time a little more serious:Of course that is the obvious answer. The reason I posted the way I did was that you seem to fire questions in these forums without putting too much effort in yourself.So do us and yourself a favor and take this all a little more serious because that will pay back.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
hannes08 Posted April 28, 2011 Share Posted April 28, 2011 So... First of all-thanks to all! Second: My solution is: $search = FileFindFirstFile("C:\temp\*getName_*") If $search = -1 Then ConsoleWrite("search failed") Else ConsoleWrite("search passed") ;in $value we'll get file name $value= FileFindNextFile($search) EndIf That's a start, but with this you'll only find one file, not all of them. Look at the example in the manual. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now