somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 Run this: #include <Array.au3> #include <File.au3> Local $amaster = _FileListToArray("E:\BKP\ESX1\") _ArrayDisplay($amaster) The element you want will look like $amaster[number]. This is the variable to use in the FileGetTime function. Note that function also returns an array, or a plain string of text if you specify. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 ok thanks it worked, now I need to get FileGetTime working. Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 I don't get how to get FileGetTime to work. Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 I am rewriting the code you posted in #20 to work on my machine. I'll be back, but don't hold your breath.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 oh sorry I tought you were gone, I'm glad you still help me Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 Ok. I have rewritten your code a bit, I'll post it below, along with your code (commented out), so you can see the changes I've made to it. Ask some more if you have any problems, or if there's something you don't understand. #cs #Include <file.au3> #include <date.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> ;################################## ; Variables ;################################## $amaster = "E:\BKP\ESX1\master.attisee.local" $dmaster = FileGetTime($amaster & "\master.attisee.local-flat.vmdk",0) $tmaster = $dmaster[0] & "-" & $dmaster[1] & "-" & $dmaster[2] & " " & $dmaster[3] & "hour " & $dmaster[4] & "min " & $dmaster[5] & "sec" $master = FileGetSize($amaster & "\master.attisee.local-flat.vmdk") MsgBox(0,"test",$master & $tmaster) #ce $amaster = @Scriptdir & "\testdir\" $dmaster = FileGetTime($amaster & "test.txt") $tmaster = $dmaster[0] & "-" & $dmaster[1] & "-" & $dmaster[2] & " " & $dmaster[3] & "hour " & $dmaster[4] & "min " & $dmaster[5] & "sec" $master = FileGetSize($amaster & "test.txt") MsgBox(0,$amaster, $master & " " & $tmaster) Note that $amaster can be defined as the directory and filename, but the two FileGet functions would have to be changed appropriately. Originally, that's how I had rewritten it, but changed it to more closely resemble your code. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 22, 2014 Author Share Posted July 22, 2014 Ok. I have rewritten your code a bit, I'll post it below, along with your code (commented out), so you can see the changes I've made to it. Ask some more if you have any problems, or if there's something you don't understand. #cs #Include <file.au3> #include <date.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> ;################################## ; Variables ;################################## $amaster = "E:\BKP\ESX1\master.attisee.local" $dmaster = FileGetTime($amaster & "\master.attisee.local-flat.vmdk",0) $tmaster = $dmaster[0] & "-" & $dmaster[1] & "-" & $dmaster[2] & " " & $dmaster[3] & "hour " & $dmaster[4] & "min " & $dmaster[5] & "sec" $master = FileGetSize($amaster & "\master.attisee.local-flat.vmdk") MsgBox(0,"test",$master & $tmaster) #ce $amaster = @Scriptdir & "\testdir\" $dmaster = FileGetTime($amaster & "test.txt") $tmaster = $dmaster[0] & "-" & $dmaster[1] & "-" & $dmaster[2] & " " & $dmaster[3] & "hour " & $dmaster[4] & "min " & $dmaster[5] & "sec" $master = FileGetSize($amaster & "test.txt") MsgBox(0,$amaster, $master & " " & $tmaster) Note that $amaster can be defined as the directory and filename, but the two FileGet functions would have to be changed appropriately. Originally, that's how I had rewritten it, but changed it to more closely resemble your code. I aldready can do this, I wanted to find a way that the script always get the directory subfolder inside "E:BKPESX1master.attisee.local" no matter what this subfolder name is. thats the reason why I am using FileListToArray Function. everyday there a backup of the vm with robocopy that a folder with CURRENT date and time at end of the folder name, the backup files are inside this folder. If I want this script to be functional everyday, it must get this folder name and return results into a variable (as i know so far). FileListToArray was a test after searching on forums to find a way to get folder name. I hope you understanding me, if not then advise me. Regards, AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 22, 2014 Share Posted July 22, 2014 Ok, try this. In this particular case, I have two sub-directories in $amaster, 'testdir1' and 'testdir2', along with that file I was using earlier, but with the parameter '2', _FileList only returns the directories, which I believe you are aware of. #include <Array.au3> #include <File.au3> $amaster = @Scriptdir & "\testdir\" $fmaster = _FileListToArray($amaster, "*", 2) _ArrayDisplay($fmaster) So, $fmaster[0] is the number of directories found (2 in my case), $fmaster[1] is the name of the first directory and $fmaster[2] is the name of the second one. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 23, 2014 Author Share Posted July 23, 2014 Ok, try this. In this particular case, I have two sub-directories in $amaster, 'testdir1' and 'testdir2', along with that file I was using earlier, but with the parameter '2', _FileList only returns the directories, which I believe you are aware of. #include <Array.au3> #include <File.au3> $amaster = @Scriptdir & "\testdir\" $fmaster = _FileListToArray($amaster, "*", 2) _ArrayDisplay($fmaster) So, $fmaster[0] is the number of directories found (2 in my case), $fmaster[1] is the name of the first directory and $fmaster[2] is the name of the second one. I only have 1 directory so this is for sure [1] to be used but how can I use $fmaster[1] in FileGetTime function? Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 23, 2014 Share Posted July 23, 2014 The FileGetTime function cannot be used for a directory. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 23, 2014 Author Share Posted July 23, 2014 (edited) $amaster = _FileListToArray("C:UserstestDesktoptestdir","*",2,True) $dmaster = FileGetTime($amaster[1] & "test.txt") actually worked idk how and why,,, Edited July 23, 2014 by AutomateLover Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 23, 2014 Share Posted July 23, 2014 $amaster[1] & "test.txt" is equal to "pathfilename.ext" so FileGetTime would work on that. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 23, 2014 Author Share Posted July 23, 2014 $amaster = _FileListToArray("C:UserstestDesktoptestdir","*",2,True) $dmaster = FileGetTime($amaster[1] & "test.txt") actually worked idk how and why,,, $amaster[1] & "test.txt" is equal to "pathfilename.ext" so FileGetTime would work on that. inside testdir i have "uhdfuhfds" folder so it basically retrieve this folder name no matter what would be the name. Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 23, 2014 Share Posted July 23, 2014 $amaster = _FileListToArray("C:UserstestDesktoptestdir","*",2,True) That syntax is wrong. That UDF function accepts only 3 parameters. The last one you have, "True", is not required. Maybe you have an old version of AutoIt in which that parameter was used. What version do you have? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 23, 2014 Author Share Posted July 23, 2014 $amaster = _FileListToArray("C:UserstestDesktoptestdir","*",2,True) That syntax is wrong. That UDF function accepts only 3 parameters. The last one you have, "True", is not required. Maybe you have an old version of AutoIt in which that parameter was used. What version do you have? I used "True" to force it to use this parameter in case it would be by default "False" Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 23, 2014 Author Share Posted July 23, 2014 ok, I tested without "True" and im back to "subscript used on non-accessible variable." then added back "True" and now its working without errors. Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 23, 2014 Share Posted July 23, 2014 Well then maybe you are using a newer version than I. I'm using 3.3.8.1, again, what version are you using? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
WilliamasKumeliukas Posted July 23, 2014 Author Share Posted July 23, 2014 lastest version ( not beta ) Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
Solution WilliamasKumeliukas Posted July 23, 2014 Author Solution Share Posted July 23, 2014 (edited) SOLVED! FINALLY GOT IT WORKING! all those problems was only because my variables wasn't organized properly. Thank you so much for your help somdcomputerguy and November Couldn't been done without your helps! I really appreciate it. Best Regards, AutomateLover Edited October 22, 2020 by WilliamasKumeliukas Sorry if it's quite challenging to understand me sometimes, there is 2 possible reasons to this: Spoiler #1. I am a native French speaker and learned English mainly from chatting with others players in online games. #2. I have a developmental disorder mainly affecting my social abilities, way of thinking, understanding stuffs and explaining myself in which it can seem ironic of seeing me here, but I been working on getting better every days for an dozens of years now ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do not like my dirty code? It's fine, but in my opinion, the dirty codes are unique and I believe it's a good glimpse of how the mind of the person who wrote it thinks, and that, that's what I call a psychological deduction step by step in all its splendor. ~WilliamasKumeliukas Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 23, 2014 Share Posted July 23, 2014 Well I'm glad you got it working for you! - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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