Gif Posted May 25, 2007 Share Posted May 25, 2007 is there any way to get the extension of a file? like to know if it is .exe or .zip or even if there is not any extension (directory) Link to comment Share on other sites More sharing options...
Zedna Posted May 25, 2007 Share Posted May 25, 2007 #include <File.au3> _PathSplit() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Gif Posted May 25, 2007 Author Share Posted May 25, 2007 #include <File.au3> _PathSplit() thanks a lot Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 25, 2007 Share Posted May 25, 2007 ...or even if there is not any extension (directory)Not having an extension is NOT a good test for a directory! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Gif Posted May 26, 2007 Author Share Posted May 26, 2007 Not having an extension is NOT a good test for a directory! not having an extension means its a directory , however the "problem" is solved Link to comment Share on other sites More sharing options...
ResNullius Posted May 26, 2007 Share Posted May 26, 2007 not having an extension means its a directory , however the "problem" is solvedI think what PsaltyDS means is that a directory CAN have an extension. For instance, I have several directories on my drive that have been renamed to something with a descriptive extension: like if I want to compare a fresh program installation to an corrupted one, I'll rename the original from something like C:\Program Files\myProgram to C:\Program Files\myProgram.old and thus my directory now has an extension. So any code that differentiated between files and directories merely on the basis of whether there was an extension or not would think "myProgram.old" was a file but it's not. Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 26, 2007 Share Posted May 26, 2007 I think what PsaltyDS means is that a directory CAN have an extension. My point exactly, AND that a file might not have extension, yet not become a directory. Run this: $TopDir = @TempDir & "\Extension Demo" Dim $avDirs[2] = ["\DirNoExt", "\DirWithExt.txt"] Dim $avFiles[2] = ["\FileNoExt", "\FileWithExt.txt"] For $d = 0 To 1 DirCreate($TopDir & $avDirs[$d]) For $f = 0 To 1 FileWriteLine($TopDir & $avDirs[$d] & $avFiles[$f], @HOUR & ":" & @MIN & ":" & @SEC) Next Next ShellExecute('explorer', '"' & $TopDir & '"') Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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