#336 closed Feature Request (Rejected)
Add DirGetTime function
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
I think a good idea add DirGetTime function.
I need this and "simulated" by this code:
Func DirGetTime ($path, $option = 0, $format = 0)
Local $FSO = ObjCreate("Scripting.FileSystemObject")
Local $Folder = $FSO.GetFolder($path)
Local $date
Switch $option
Case 0
$date = $Folder.DateLastModified()
Case 1
$date = $Folder.DateCreated()
Case Else
$date = $Folder.DateLastAccessed()
EndSwitch
If $format = 0 Then
$date = StringRegExp($date, "(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})", 1)
EndIf
Return $date
EndFunc
Attachments (0)
Change History (8)
comment:1 by , 18 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | new → closed |
follow-up: 5 comment:4 by , 18 years ago
Replying to fherrero@noticiasdenavarra.com:
I try this first and not work... bug?
Ask on the forum. You are probably making a mistake by placing a trailing slash on the path or something.
follow-up: 6 comment:5 by , 18 years ago
Replying to Valik:
Replying to fherrero@noticiasdenavarra.com:
I try this first and not work... bug?
Ask on the forum. You are probably making a mistake by placing a trailing slash on the path or something.
OK, I tryed MsgBox(0, "hola", FileGetTime("e:\_", 1, 1)) and works but MsgBox(0, "hola", FileGetTime("e:\_\", 1, 1)) not work
In my experience with VBS and php when dealing with directories like whether they gave the last slash or not
follow-up: 7 comment:6 by , 18 years ago
Replying to anonymous:
OK, I tryed MsgBox(0, "hola", FileGetTime("e:\_", 1, 1)) and works but MsgBox(0, "hola", FileGetTime("e:\_\", 1, 1)) not work
In my experience with VBS and php when dealing with directories like whether they gave the last slash or not
This isn't VBS or PHP, this is AutoIt. Do what AutoIt expects, not what other languages expect.
comment:7 by , 18 years ago
Replying to Valik:
This isn't VBS or PHP, this is AutoIt. Do what AutoIt expects, not what other languages expect.
Of course this is AutoIt, but is usually indifferent to refer to directories with or without slash end ... is what is commonly expected.
My reference to VB or PHP were just examples of what I say.
I do not know the difficulty of modifying the function FileGetTime to act in this way, but much help to developers.
Thank you for your attention and help.
comment:8 by , 18 years ago
Last one: in the documentation makes no reference to the function is valid for directories nor specifies that the names of the directories have to go without the slash final.
http://www.autoitscript.com/autoit3/docs/functions/FileGetTime.htm

FileGetTime() works on directories. Closing as Rejected.