Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Arno Garrels
Dan wrote:
> - Original Message -
> From: "Nikolay Simeonov" <[EMAIL PROTECTED]>
>> I would easier debug it but in the service I cannot go
>> step by step through the component's sources.
>
> You can use Attach to Process in the Delphi IDE.

I never got that working in D4-D5 :(, but Wilfried Mestdagh  
wrote a nice little tool.
http://users.pandora.be/sonal.nv/ 
Delphi software -> Delphi hacks -> GUI as NT service

Arno Garrels






--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Dan
- Original Message - 
From: "Nikolay Simeonov" <[EMAIL PROTECTED]>
To: "'ICS support mailing'" 
Sent: Tuesday, April 26, 2005 12:24 PM
Subject: RE: [twsocket] FTP client and windows service problem


But in this case FTPclient1.Dir would return true and in my case it's
returning false. However no exception is thrown and I'm lost how to figure
out WHY I'm getting false there and what the problem could be.
Everything is working just fine as Windows Application - it's getting the
folder listing, downloading the files etc., but when I use the same unit 
in
a Service I'm getting false when I call the DIR function. If the windows
program was crashing I would easier debug it but in the service I cannot 
go
step by step through the component's sources.

You can use Attach to Process in the Delphi IDE.
Dan 

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Arno Garrels
Nikolay Simeonov wrote:
> But in this case FTPclient1.Dir would return true and in my case it's
> returning false. 

Check the StatusCode, on listing an empty directory it may be either 450 or 550.

450 Requested file action not taken. File unavailable (e.g., file busy).
550 Requested action not taken. File unavailable (e.g., file not found, no 
access).


> However no exception is thrown and I'm lost how to figure
> out WHY I'm getting false there and what the problem could be.
> 
> Everything is working just fine as Windows Application - it's getting the
> folder listing, downloading the files etc., but when I use the same unit
> in a Service I'm getting false when I call the DIR function.

So you are not listing an empty directory here.

> If the
> windows program was crashing I would easier debug it but in the service I
> cannot go step by step through the component's sources.

Arno Garrels 


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Dan
Can you list to a MemoryStream just to rule out permissions problems.
Dan
- Original Message - 
From: "Nikolay Simeonov" <[EMAIL PROTECTED]>
To: "'ICS support mailing'" 
Sent: Tuesday, April 26, 2005 11:58 AM
Subject: RE: [twsocket] FTP client and windows service problem


It was saving the data in the service's folder and I'm 100% sure it had 
the
proper permissions to do that. The file was created but with a size of 0.


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Francois Piette
It's easy to do a quick test using a TFileStream to write something in the 
service's folder to
confirm it's a permission problem or not.
--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: "Nikolay Simeonov" <[EMAIL PROTECTED]>
To: "'ICS support mailing'" 
Sent: Tuesday, April 26, 2005 12:58 PM
Subject: RE: [twsocket] FTP client and windows service problem


> It was saving the data in the service's folder and I'm 100% sure it had the
> proper permissions to do that. The file was created but with a size of 0.
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Angus Robertson - Magenta Systems Ltd
> Sent: Tuesday, April 26, 2005 1:49 PM
> To: twsocket@elists.org
> Subject: RE: [twsocket] FTP client and windows service problem
>
> > It definitely has the permissions because I ran it as an
> > administrator. I tried as local system as well - both have full access
> > granted for this folder (as a matter of fact - for every folder on my
> > development machine).
>
> Applications running in the service window do not get the same rights as
> logged-on users, in particular mapped network drives are not available, you
> have to use full UNC paths.
>
> Angus
>
> --
> To unsubscribe or change your settings for TWSocket mailing list please goto
> http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


RE: [twsocket] FTP client and windows service problem

2005-04-26 Thread Nikolay Simeonov
But in this case FTPclient1.Dir would return true and in my case it's
returning false. However no exception is thrown and I'm lost how to figure
out WHY I'm getting false there and what the problem could be.

Everything is working just fine as Windows Application - it's getting the
folder listing, downloading the files etc., but when I use the same unit in
a Service I'm getting false when I call the DIR function. If the windows
program was crashing I would easier debug it but in the service I cannot go
step by step through the component's sources.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Arno Garrels
Sent: Tuesday, April 26, 2005 2:17 PM
To: ICS support mailing
Subject: Re: [twsocket] FTP client and windows service problem

Nikolay Simeonov wrote:
> It was saving the data in the service's folder and I'm 100% sure it 
> had the proper permissions to do that. The file was created but with a 
> size of 0.

That's normal when you list an empty directory.

Arno Garrels



--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Arno Garrels
Nikolay Simeonov wrote:
> It was saving the data in the service's folder and I'm 100% sure it had
> the proper permissions to do that. The file was created but with a size
> of 0. 

That's normal when you list an empty directory.

Arno Garrels



--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


RE: [twsocket] FTP client and windows service problem

2005-04-26 Thread Nikolay Simeonov
It was saving the data in the service's folder and I'm 100% sure it had the
proper permissions to do that. The file was created but with a size of 0.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Angus Robertson - Magenta Systems Ltd
Sent: Tuesday, April 26, 2005 1:49 PM
To: twsocket@elists.org
Subject: RE: [twsocket] FTP client and windows service problem

> It definitely has the permissions because I ran it as an 
> administrator. I tried as local system as well - both have full access 
> granted for this folder (as a matter of fact - for every folder on my 
> development machine).

Applications running in the service window do not get the same rights as
logged-on users, in particular mapped network drives are not available, you
have to use full UNC paths.  

Angus

--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


RE: [twsocket] FTP client and windows service problem

2005-04-26 Thread Angus Robertson - Magenta Systems Ltd
> It definitely has the permissions because I ran it as an 
> administrator. I
> tried as local system as well - both have full access granted for this
> folder (as a matter of fact - for every folder on my development 
> machine).

Applications running in the service window do not get the same rights 
as logged-on users, in particular mapped network drives are not 
available, you have to use full UNC paths.  

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


RE: [twsocket] FTP client and windows service problem

2005-04-26 Thread Nikolay Simeonov
It definitely has the permissions because I ran it as an administrator. I
tried as local system as well - both have full access granted for this
folder (as a matter of fact - for every folder on my development machine).

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Arno Garrels
Sent: Tuesday, April 26, 2005 1:11 PM
To: ICS support mailing
Subject: Re: [twsocket] FTP client and windows service problem

Nikolay Simeonov wrote:
> Hi Arno,
> 
> I did use any possible way that occurred to my mind to figure out what 
> the problem is without any success. And as I said - it's working just 
> fine when I am testing it from a standart windows application, but 
> when I start the service it's crashing. What I was getting from the 
> DIR command is that it couldn't save the file. I also tried generating 
> a random file name for the directory listing and it didn't help 
> either. Is there another way to capture the directory listing without
saving it to a file?

As Francois wrote before this sounds like a permission problem.
Check NTFS rights. If your service runs as the LocalSystem the user is
System.
 
>> I've downloaded a unit named ftpcommon.pas somewhere that helps 
>> parsing a
> lot, but I can't find the link at the moment:(
> 
> If you can send me a copy ot this unit I would be eternally thankful to
> you :) Send it to @.net   (not .com)

The link is in Francois' message as well.

Arno Garrels

--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Arno Garrels
Nikolay Simeonov wrote:
> Hi Arno,
> 
> I did use any possible way that occurred to my mind to figure out what the
> problem is without any success. And as I said - it's working just fine
> when I am testing it from a standart windows application, but when I
> start the service it's crashing. What I was getting from the DIR command
> is that it couldn't save the file. I also tried generating a random file
> name for the directory listing and it didn't help either. Is there
> another way to capture the directory listing without saving it to a file?

As Francois wrote before this sounds like a permission problem.
Check NTFS rights. If your service runs as the LocalSystem the user is System.
 
>> I've downloaded a unit named ftpcommon.pas somewhere that helps parsing a
> lot, but I can't find the link at the moment:(
> 
> If you can send me a copy ot this unit I would be eternally thankful to
> you :) Send it to @.net   (not .com)

The link is in Francois' message as well.

Arno Garrels

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


RE: [twsocket] FTP client and windows service problem

2005-04-26 Thread Nikolay Simeonov
Hi Arno,

I did use any possible way that occurred to my mind to figure out what the
problem is without any success. And as I said - it's working just fine when
I am testing it from a standart windows application, but when I start the
service it's crashing. What I was getting from the DIR command is that it
couldn't save the file. I also tried generating a random file name for the
directory listing and it didn't help either. Is there another way to capture
the directory listing without saving it to a file? 

> I've downloaded a unit named ftpcommon.pas somewhere that helps parsing a
lot, but I can't find the link at the moment:(

If you can send me a copy ot this unit I would be eternally thankful to you
:) Send it to @.net   (not .com)

Best Regards,
Nikolay Simeonov


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Arno Garrels
Sent: Tuesday, April 26, 2005 10:14 AM
To: ICS support mailing
Subject: Re: [twsocket] FTP client and windows service problem

Nikolay Simeonov wrote:
> Hello Francois,
> 
> I'm writing a service and when I try to get the directory FTP1.Dir 
> returns false. How can I pinpoint the problem and is there a way to 
> figure out why it's returning false?

There is i.e. property StatusCode and there are events also.
You may assign OnDisplay and write to a log file as well.
Or use async methods and handle your program flow from within the
OnRequestDone-handler.

> 
> I'm using it in non-multithread mode. What's more curious about the 
> code is the fact it works when I use the same unit from a normal 
> windows program. And from the service it's crashing.
> Do you have any ideas what
> could possibly cause the error?

Without some more information, it's hard to say anything. 
 
> Also a side problem I'm having is: do you know of a simple way to 
> parse the results from the DIR command into a simple list of 
> filenames, sizes, attributes (directory or a file) and timestamp? All 
> I'm getting is a text file and currently I hardcoded the parsing, and 
> that isn't listed anywhere as best practice, but all I wanted is to 
> get it working quickly and clean it up later.

I've downloaded a unit named ftpcommon.pas somewhere that helps parsing a
lot, but I can't find the link at the moment:(

Arno Garrels 
 


--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Arno Garrels
Nikolay Simeonov wrote:
> Hello Francois,
> 
> I'm writing a service and when I try to get the directory FTP1.Dir returns
> false. How can I pinpoint the problem and is there a way to figure out why
> it's returning false?

There is i.e. property StatusCode and there are events also.
You may assign OnDisplay and write to a log file as well.
Or use async methods and handle your program flow from within 
the OnRequestDone-handler.

> 
> I'm using it in non-multithread mode. What's more curious about the code
> is the fact it works when I use the same unit from a normal windows
> program. And from the service it's crashing.
> Do you have any ideas what
> could possibly cause the error?

Without some more information, it's hard to say anything. 
 
> Also a side problem I'm having is: do you know of a simple way to parse
> the results from the DIR command into a simple list of filenames, sizes,
> attributes (directory or a file) and timestamp? All I'm getting is a text
> file and currently I hardcoded the parsing, and that isn't listed anywhere
> as best practice, but all I wanted is to get it working quickly and clean
> it up later.

I've downloaded a unit named ftpcommon.pas somewhere that helps parsing a lot,
but I can't find the link at the moment:(

Arno Garrels 
 


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] FTP client and windows service problem

2005-04-26 Thread Francois Piette
Maybe you have a file permission problem. Your service is logged under system 
account or another
account. Check that it has the required permissions.

> Also a side problem I'm having is: do you know of a simple way to parse the
> results from the DIR command into a simple list of filenames, sizes,

There is source code available at http://www.smatters.com/ics/. Rather old but 
still working.
--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: "Nikolay Simeonov" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, April 26, 2005 1:44 AM
Subject: [twsocket] FTP client and windows service problem


> Hello Francois,
>
> I'm writing a service and when I try to get the directory FTP1.Dir returns
> false. How can I pinpoint the problem and is there a way to figure out why
> it's returning false?
>
> I'm using it in non-multithread mode. What's more curious about the code is
> the fact it works when I use the same unit from a normal windows program.
> And from the service it's crashing. Do you have any ideas what could
> possibly cause the error?
>
> Also a side problem I'm having is: do you know of a simple way to parse the
> results from the DIR command into a simple list of filenames, sizes,
> attributes (directory or a file) and timestamp? All I'm getting is a text
> file and currently I hardcoded the parsing, and that isn't listed anywhere
> as best practice, but all I wanted is to get it working quickly and clean it
> up later.
>
> Thanks in advance for any help and ideas,
> Nikolay Simeonov
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be