[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] [bug #15098] Process.StartInfo.WorkingDirectory does n
From: |
Radek Polak |
Subject: |
[Pnet-developers] [bug #15098] Process.StartInfo.WorkingDirectory does not work |
Date: |
Tue, 29 Nov 2005 18:47:02 +0000 |
User-agent: |
Mozilla/5.0 (compatible; Konqueror/3.3; Linux) (KHTML, like Gecko) |
URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=15098>
Summary: Process.StartInfo.WorkingDirectory does not work
Project: DotGNU Portable.NET
Submitted by: radekp
Submitted on: Tue 11/29/05 at 18:47
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
_______________________________________________________
Details:
Hello,
This patch implements/fixes Process.StartInfo.WorkingDirectory parameter and
fixes some other related problems.
I have added workingDir parameter to StartProcess() internal call. This
means, that applying this patch involves:
- patch Process.cs
- rebuild pnetlib
- run mkint.sh in pnet/engine
- patch lib_task.c
- commit
Things that have been done:
1) Fixed obvious typo in Process.cs line 915. Path.PathSeparator was used to
combine path, whitch is invalid because it is char ':'. Path.Combine() or
Path.DirectorySeparator should be used instead.
2) WorkingDirectory is implemented to behave the same way as in .NET. I had
to write a test programs to find out the behaviour, because MSDN
documentation does not correspond to .NET implementation (and according to
these documents, WorkingDirectory would be quite useless). Implementation
behaves now like following:
a) WorkingDirectory is always directory where the new process is started -
figures as CurrentDirectory in started process
b) if(UseShellExecute==true && FileName is realative path)
{
combine WorkingDirectory + Filename and start process from that
location.
}
c) if(UseShellExecute==false)
{
directly start process where FileName points to executable location
(do not combine WorkingDirectory and FileName)
}
3) There was added a line to clear errno in the beginning of cygwin part for
_IL_Process_StartProcess(). Errno was hanging there from some previous
operation e.g. from ILFileExists(). This caused that checking for Errno
always threw exception (Process.cs line 946).
4) Above mentioned checking for Errno is now done conditionaly - only when
_IL_Process_StartProcess() returns false. (Did it make sense to check for
error if that function returned success?)
5) Added passing of workingDir parameter to CreateProcess (cygwin part).
Added ILChangeDir() to switch current directory in forked process (linux).
I've also attached simple test program, that prints process start parameters,
and start process that prints it's current directory (standard pwd program for
unices, message box with current dir for windows).
Patch works for me on gentoo/cygwin though I will do some more testing
tommorow, because i had to finnish it in time pressure.
Thanks to KlausT and MarcusU for help.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 11/29/05 at 18:47 Name: Process_WorkingDir.tar.gz Size: 13.85KB
By: radekp
patches and test program
<http://savannah.gnu.org/bugs/download.php?item_id=15098&item_file_id=3145>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=15098>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pnet-developers] [bug #15098] Process.StartInfo.WorkingDirectory does not work,
Radek Polak <=