Jump to content

file extension


Recommended Posts

...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

not having an extension means its a directory , however the "problem" is solved

I 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...