JustDoIt 0 Posted September 8, 2007 Can someone tell me how to in AutoIt read the name of a file (not the content of the file) into a string ??? TIA. Share this post Link to post Share on other sites
Kram3r 0 Posted September 8, 2007 (edited) Explain better. If you dont know the file name, where are the file ? How do you know the file that you want to know the name ? Dim $file Dim $tmp $file="test.txt" $tmp=fileread($file) msgbox(0,"test","This are file contents"&$tmp&" and this are the file name "&$file) Edited September 8, 2007 by Kram3r To all the Devs: Thkx for AutoIt To all Mods: Thkx for the quality forum Share this post Link to post Share on other sites
JustDoIt 0 Posted September 8, 2007 Explain better. If you dont know the file name, where are the file ?How do you know the file that you want to know the name ?Files are created from the run of an application. File name's format is already specified inside the program but the files' names vary depending on the workload. So, I would like to check the names (of the files that are generated after the program's run) to see they are in expected format. Share this post Link to post Share on other sites
JustDoIt 0 Posted September 8, 2007 (edited) Dim $file Dim $tmp $file="test.txt" $tmp=fileread($file) msgbox(0,"test","This are file contents"&$tmp&" and this are the file name "&$file) It returns the file name as "1", while it's actually "test.txt" Edited September 8, 2007 by JustDoIt Share this post Link to post Share on other sites
Kram3r 0 Posted September 8, 2007 (edited) You can use for your case: _FileListToArray () Description: Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch) PS: In my environment the above example returns "test.txt" for the file name. Edited September 8, 2007 by Kram3r To all the Devs: Thkx for AutoIt To all Mods: Thkx for the quality forum Share this post Link to post Share on other sites
JustDoIt 0 Posted September 8, 2007 _FileListToArray () is what I need. Thanks. Share this post Link to post Share on other sites
Kram3r 0 Posted September 8, 2007 You welcome, glad to help you. To all the Devs: Thkx for AutoIt To all Mods: Thkx for the quality forum Share this post Link to post Share on other sites