AutoHotkey Community

It is currently May 26th, 2012, 5:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: April 8th, 2008, 5:27 am 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
THE SOURCE CODE: http://autohotkey.net/~nkruzan/MiniFTP3.zip
License

Code:
/* This program is free software. It comes without any warranty, to
 * the extent permitted by applicable law. You can redistribute it
 * and/or modify it under the terms of the Do What The **** You Want
 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING for more details. */

Thanks to Olfen, Maj, Titan, Adde_P, DerRaphael, Sean and anyone else I may have used code from. I will try to put more credits in the source later.

Comments, Bugs, Suggestions welcome. Feel free to make your own changes and modify it to your hearts content.

Image

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Last edited by ahklerner on April 9th, 2008, 8:15 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 8th, 2008, 7:58 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Added license to first post

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 9th, 2008, 4:12 am 
It works :)
Awesome ahk work.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 9th, 2008, 4:15 am 
i wonder whats the difference between this and the others :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 17th, 2008, 11:49 pm 
Online
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
you have once again earned my profound respect

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 18th, 2008, 5:19 am 
ahklerner wrote:

...BEST...LICENSE...EVER!...I of course normally don't read or care about licenses...but when I hovered on it & saw "wtfpl" in the url...I HAD to click!...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 3:54 pm 
I tried adding more info headers to the listview.

I'm having issues with getting the correct date from files (FileTimeToLocalFileTime and FileTimeToSystemTime).

Like you can see, the timestamps it returns are complete gibberish.

Image

I tried adapting the code from the following postings:

- SKAN's ProcessCreationTime function
- FileGetTime with milliseconds
- The different attempts at DllCall: Basic FTP Functions

The minor changes I made to MiniClient.ahk to add the extra headers:

Code:
line 83:
Gui, 1:Add, ListView, x170 y%yOffset% w480 h200 gFileSelect AltSubmit vMiniFTP_ServerList hwndMiniFTP_hFileList -TabStop, Name | Size | Attrib | Path | Creation Time | Last access time | Last write time

line 356:
LV_Add("",GetItem(pFiles, ThisSelection . "_" . A_Index  . "_Name"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_Size") . " " . GetItem(pFiles, ThisSelection . "_" . A_Index . "_SizeType"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_Attrib"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_Path"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_CreationTime"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_LastAccessTime"), GetItem(pFiles, ThisSelection . "_" . A_Index . "_LastWriteTime"))



Different attempts at changing/adapting the FileTimeToStr function in FTP.ahk (none of which seem to work)

Code:
/*

FileTimeToStr(FileTime) {
   VarSetCapacity(SystemTime, 16, 0)
   DllCall("FileTimeToSystemTime", "uint", &FileTime, "uint", &SystemTime)
   Return NumGet(SystemTime,2,"short")
      . "/" . NumGet(SystemTime,6,"short")
      . "/" . NumGet(SystemTime,0,"short")
      . " " . NumGet(SystemTime,8,"short")
      . ":" . NumGet(SystemTime,10,"short")
      . ":" . NumGet(SystemTime,12,"short")
      . "." . NumGet(SystemTime,14,"short")
}

*/

/*

; FileTimeToSystemTime: http://msdn2.microsoft.com/en-us/library/ms724280.aspx
;~ typedef struct _SYSTEMTIME {
;~   WORD wYear;
;~   WORD wMonth;
;~   WORD wDayOfWeek;
;~   WORD wDay;
;~   WORD wHour;
;~   WORD wMinute;
;~   WORD wSecond;
;~   WORD wMilliseconds;
;~ } SYSTEMTIME;
FileTimeToStr(ByRef @FileTime)
{
   VarSetCapacity(SystemTime, 16, 0)
   DllCall("FileTimeToLocalFileTime", "uint", &@FileTime, "uint", &@FileTime)
   DllCall("FileTimeToSystemTime", "uint", &@FileTime, "uint", &SystemTime)

   str .= NumGet(SystemTime, 0, "ushort")
   str .= StrLen(Word := NumGet(SystemTime,  2,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime,  6,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime,  8,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime, 10,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime, 12,"ushort")) == 1 ? ("0" . Word) : Word
   return str
}
*/

/*
FileTimeToStr(FileTime) {                       
 DllCall( "FileTimeToLocalFileTime", Int64P,FileTime, Int64P,Local ), AT := 1601
 AT += % Local//10000000, S
 Return AT
}
*/

;/*
; FileTimeToSystemTime: http://msdn2.microsoft.com/en-us/library/ms724280.aspx
;~ typedef struct _SYSTEMTIME {
;~   WORD wYear;
;~   WORD wMonth;
;~   WORD wDayOfWeek;
;~   WORD wDay;
;~   WORD wHour;
;~   WORD wMinute;
;~   WORD wSecond;
;~   WORD wMilliseconds;
;~ } SYSTEMTIME;
FileTimeToStr(ByRef @FileTime)
{
   VarSetCapacity(SystemTime, 16, 0)
   DllCall("FileTimeToLocalFileTime", "uint", &@FileTime, "uint", &@FileTime)
   DllCall("FileTimeToSystemTime", "uint", &@FileTime, "uint", &SystemTime)

;/*
   str .= NumGet(SystemTime, 0, "ushort")
   str .= StrLen(Word := NumGet(SystemTime,  2,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime,  6,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime,  8,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime, 10,"ushort")) == 1 ? ("0" . Word) : Word
   str .= StrLen(Word := NumGet(SystemTime, 12,"ushort")) == 1 ? ("0" . Word) : Word
   return str

;*/

 Loop 16   {       ; Extracting and concatenating 8 words from a SYSTEMTIME structure
  Word := Mod(A_Index-1,2) ? "" :  *( &SystemTime +A_Index-1 ) + ( *(&SystemTime +A_Index) << 8 )
  Time .= StrLen(Word) = 1 ? ( "0" . Word ) : Word  ; Prefixing "0" for single digits
           }

Return SubStr(Time,1,6) . SubStr(Time,9,8) ; YYYYMMDD24MISS

}

;*/


/*

FileTimeToStr( File, Mode="M" ) {    ; Topic: www.autohotkey.com/forum/viewtopic.php?t=49194
 ;If ( VarSetCapacity($,342,0)  && ( H:=DllCall( "FindFirstFile", Str,File, UInt,&$ ) ) ) {
 ;DllCall( "FindClose", UInt,H )
 VC:=&$+4, VA:=&$+12, VM:=&$+20, FT:=V%Mode%
 LFT:=&$+318 ,  DllCall( "FileTimeToLocalFileTime", UInt,FT, UInt,LFT )
 ST:=LFT+8   ,  DllCall( "FileTimeToSystemTime", UInt,LFT, UInt,ST )
 Loop 7
  T .= StrLen( N:=NumGet(ST+0,(A_Index-1)*2,"UShort") ) < 2 ? "0" N : N
Return SubStr(T,1,6) . SubStr(T,9,8) . SubStr( "00" NumGet( ST+0,14,"UShort" ), -2 )
}

*/


Anybody? :(


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 21st, 2010, 9:31 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
You will need to use InternetTimeToSystemTime
Example (requires AHK_H) and WinDlls()
Code:
_:=WinDlls("wininet.dll")
fdata:=Struct("WIN32_FIND_DATA")
time:=Struct("SYSTEMTIME")

ftp:=_.InternetConnect(int:=_.InternetOpen(A_ScriptName,1),"ftp.autohotkey.net",21,"HotKeyIt","MyPassword",1)
_.FtpFindFirstFile(ftp,"AutoHotkey.zip",fdata[""])
_.InternetTimeToSystemTime(fdata.ftCreationTime[""],time[""])
MsgBox % time.wYear . "-" time.wMonth . "-" time.wDay
         . "`n" time.wDayOfWeek
         . "`n" time.wHour . ":" time.wMinute   . ":" time.wSecond . ":" time.Milliseconds
_.InternetCloseHandle(ftp),_.InternetCloseHandle(int)


EDIT: changed WinDlls and removed StrGet in InternetTimeToSystemTime

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2011, 8:34 am 
Offline

Joined: May 9th, 2011, 1:28 pm
Posts: 5
Location: Palmdale
I love autohotkey and made some small scripts already for working faster in windows. Can I use this script with my web host too? I'm relative new to the whole webbing thing and I don't wanna pay for a ftp program.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2011, 11:36 am 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
bell-e wrote:
I love autohotkey and made some small scripts already for working faster in windows. Can I use this script with my web host too? I'm relative new to the whole webbing thing and I don't wanna pay for a ftp program.


If your webhost supports FTP access (which most do, since you need a way to put files there...), you can use this program or any other FTP program to connect to your webhost space, of course :)

As for paying, I use FileZilla which is also free. But you can probably use this script too (I haven't tried it)

_________________
~sumon Appifyer AHK Nova halted Recommended: AHK_L (Why?)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2011, 6:50 pm 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 572
This is an amazing project. I was going to search the forums for FTP information the other day but when I looked at the Scripts & Functions page this was at the top.

One thing I need to be able to do that I haven't figured out is when connecting I need to start in a specific folder, not the root folder which is selected during log in. Is there a way to do that when logging in?

For example when logging into AHK.net it starts in this folder,
Code:
autohotkey.net/xfm/list/


and I need to start in this folder.
Code:
autohotkey.net/xfm/list/?d=StartFolder


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Stigg and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group