Problem with FS plugin

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
RMK
Junior Member
Junior Member
Posts: 8
Joined: 2004-06-20, 14:21 UTC
Location: Wodzislaw Slaski / Krakow
Contact:

Problem with FS plugin

Post by *RMK »

Hi, I try to create somthing what lets me use GMAIL account as file system.
For now I can get list of files on GMAIL account [via Java program which will work as server for TC plug-in] and show those files in TC, but I have very big problem. When I return information about file via FsFindFirst and FsFindNext TC make something wrong with file attributes.
Small decrpiton:
I get whole list of files on account and send it via socket to TC plug-in, in plug-in when TC calls FsFindFirst I create list of files, and directories which are in specified path, I return first entry, and rest of entries I return in calls of FsFindNext. I set attributres of files, but here I have some problem. TC ignore those values, and use very own, and random ;-) As I suppose it is beacouse I return wrong values..... Here what I do:
first of all I fill whole Win32FindData by zeros. Next I write file name, file type, and file size [here I do something wrong because now I write only Low part of file size].
Code which is doing it looks like it: [in Delphi]
Move(fileName,Win32FindData.cFileName,StrLen(fileName));
Win32FindData.dwFileAttributes:=fType;
Win32FindData.nFileSizeHigh:=0;
Win32FindData.nFileSizeLow:=fSize;
fType and fSize are Cardinal type, as fType I send FILE_ATTRIBUTE_NORMAL for files and FILE_ATTRIBUTE_DIRECTORY. I don't use any other values of Win32FindData.
Any suggestions? ;-) Or maybe I can look anywhere in net some example of FS plugin?

> Przemysław Rumik - RMK | BuffyPedia: http://www.buffypedia.prv.pl
> | One of the universal rules of happiness is: always be wary of any |
> | helpful item that weighs less than its operating manual. |
> GG: 505188, ICQ: 102808474, WPKontakt: rmk2 | (Terry Pratchett - Jing)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50834
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You seem to do everything correctly. Can you post some more code here? Perhaps it helps us to find the error.
Author of Total Commander
https://www.ghisler.com
RMK
Junior Member
Junior Member
Posts: 8
Joined: 2004-06-20, 14:21 UTC
Location: Wodzislaw Slaski / Krakow
Contact:

Post by *RMK »

First of all I have list of files (with full path and size) in fileList (TStringList). When TC calls FsFindFirst my plug-in tests all items in fileList and put those wich are in searched path to currList (TStringList).
Next (in FsFindFirst, and in FsFindNext) string from currList is passed as parametrer to AnalyzaFile()

function AnalyzeFile(fileInfo:String;var fileName:String;fileSize:Cardinal;fileType:Cardinal):boolean;

In AnalyzeFile I checks what kind of file it is, and return fileName, fileSize, and fileType via parameters. In this procedure all values are correct.
As I noticed problem occurs when file type is returned via parameters from AnalyzeFile:

ret:=currList.Strings[currFile];
AnalyzeFile(ret,ret,fSize,fType);
// Here I have random fType values, but in AnalyzeFile those values are correct
StrPCopy(fileName,ret);
Move(fileName,Win32FindData.cFileName,StrLen(fileName));
Win32FindData.dwFileAttributes:=fType;
Win32FindData.nFileSizeHigh:=0;
Win32FindData.nFileSizeLow:=fSize;
inc(currFile);

For me it's mistical ;-)

Hmm... I try now to declare AnalyzeFile() as

function AnalyzeFile(fileInfo:String;var fileName:String;var fileSize:Cardinal;var fileType:Cardinal):boolean;

and it looks better :-)

--
Przemysław Rumik - RMK | BuffyPedia: http://www.buffypedia.prv.pl
| One of the universal rules of happiness is: always be wary of any |
| helpful item that weighs less than its operating manual. |
GG: 505188, ICQ: 102808474, WPKontakt: rmk2 | (Terry Pratchett - Jing)
RMK
Junior Member
Junior Member
Posts: 8
Joined: 2004-06-20, 14:21 UTC
Location: Wodzislaw Slaski / Krakow
Contact:

Post by *RMK »

OK, it seems that it was problem with my Delphi knowledge ;-) Problem was with passing values from function via parameters.
I always thought that functionName(param1:type1;var param2:type2;param3:type3) means that it should pass correct values from procedure by param2 and param3 :-)

--
Przemysław Rumik - RMK | BuffyPedia: http://www.buffypedia.prv.pl
| One of the universal rules of happiness is: always be wary of any |
| helpful item that weighs less than its operating manual. |
GG: 505188, ICQ: 102808474, WPKontakt: rmk2 | (Terry Pratchett - Jing)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50834
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed you forgot one "var", something which happens to me too from time to time even after >10 years of TPW and Delphi. The function should of course be

function AnalyzeFile(fileInfo:String;var fileName:String;var fileSize:Cardinal;var fileType:Cardinal):boolean;
Author of Total Commander
https://www.ghisler.com
RMK
Junior Member
Junior Member
Posts: 8
Joined: 2004-06-20, 14:21 UTC
Location: Wodzislaw Slaski / Krakow
Contact:

Post by *RMK »

Good to know that even good programmers do mistakes :-)

For now my plug-in can put and get files from GMAIL account, but is rather not too easy to use ;-) first user must run server [written in Java], second for now password and account name are hardcoded in plug-in ;-) But it works fine for me.

If anybody is interested in obtain plug-in for access to GMAIL account via TotalCommander I can write more user-friendly version ;-) I think sources for server and plug-in will be avaible on my side something near tommorow :-)

--
Przemysław Rumik - RMK | BuffyPedia: http://www.buffypedia.prv.pl
| One of the universal rules of happiness is: always be wary of any |
| helpful item that weighs less than its operating manual. |
GG: 505188, ICQ: 102808474, WPKontakt: rmk2 | (Terry Pratchett - Jing)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50834
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Btw, www.heise.de just announced that Gmail is now allowing POP3 access! So you can finally access it with normal mail clients, or even the POP3 Totalcmd plugin.
Author of Total Commander
https://www.ghisler.com
RMK
Junior Member
Junior Member
Posts: 8
Joined: 2004-06-20, 14:21 UTC
Location: Wodzislaw Slaski / Krakow
Contact:

Post by *RMK »

For now it's avaible only for part of users :-( but I hope it will be soon possible to access to all GMAIL accounts via POP3 :-) and maybe SMTP ;-)

--
Przemysław Rumik - RMK | BuffyPedia: http://www.buffypedia.prv.pl
| One of the universal rules of happiness is: always be wary of any |
| helpful item that weighs less than its operating manual. |
GG: 505188, ICQ: 102808474, WPKontakt: rmk2 | (Terry Pratchett - Jing)
Hammillian7
Member
Member
Posts: 107
Joined: 2003-07-16, 22:40 UTC
Location: Spain

Can't access Gmail with POP3 plugin

Post by *Hammillian7 »

ghisler(Author) wrote:Btw, www.heise.de just announced that Gmail is now allowing POP3 access! So you can finally access it with normal mail clients, or even the POP3 Totalcmd plugin.
Just when I was announced the Gmail availability through POP3, I've tried the André Martin's POP3 plugin (which I love), but without success. I imagine it might be due to the complicated gmail authentication scheme. (I've tried with both values in "APop" authentication option).

Has anybody succeeded?

Could we expect POP3 plugin to be adapted to gmail?

Thanks.
RMK
Junior Member
Junior Member
Posts: 8
Joined: 2004-06-20, 14:21 UTC
Location: Wodzislaw Slaski / Krakow
Contact:

Re: Can't access Gmail with POP3 plugin

Post by *RMK »

Hammillian7 wrote: Could we expect POP3 plugin to be adapted to gmail?
I created plug-in which let's on access to GMAIL account as File System, but when google changed login process my plug-in stops to work ;-)
Now I wait for modifications in g4j library, and when or rather if it will be done my GmailFS4TC will be again properly work ;-)

And with POP3 plug-in I suppose it's problem with this that boys and girls from google put POP3 only as kind of proxy on theirs system. Getting mail from account means also deleting it from POP3 proxy. This mean that if you get your mail via POP3 on GMAIL it won't be possible to take this mail again this way. It's a feature of GMAIL, and it looks like access to account as file system is and will possible only via www. But I hope I'm wrong :-)

--
Przemysław Rumik - RMK | BuffyPedia: http://www.buffypedia.prv.pl
| One of the universal rules of happiness is: always be wary of any |
| helpful item that weighs less than its operating manual. |
GG: 505188, ICQ: 102808474, WPKontakt: rmk2 | (Terry Pratchett - Jing)
Post Reply