PDA

View Full Version : C# program not acting right


lsutiger2008
11th September 2008, 00:06
I have a program that is supposed to zip a bunch of files and name them to a standard for each of our locations. The program was originally written in VS for windows and worked great.
I now rewrote it in Mono-develop for linux and of course I had to change the path information of zip.
Here's the relevant codestrArgs = DateTime.Now.AddMonths(-1).ToShortDateString();

strArgs = strArgs.PadLeft(10,'0');

strArgs = strArgs.Remove(2,4);

file = file.PadLeft(2,'0');
strArgs = " /home/brian/EOM" + file + strArgs + ".ZIP";

path = " /home/brian/EOM/" + file + "/*.M" + file;

strArgs = strArgs + path;
//Console.Write(strArgs);

myProcess.StartInfo.FileName = "zip";

myProcess.StartInfo.Arguments = strArgs;

myProcess.StartInfo.CreateNoWindow = true;

try

{

myProcess.Start();

myProcess.WaitForExit();



}

catch (SystemException caught)

{

Console.WriteLine(caught.ToString());

continue;

}
This produces a string of arguments as such:
/home/brian/EOM01082008.ZIP /home/brian/EOM/01/*.M01
but I get "zip warning: name not matched: /home/brian/EOM/01/*.M01" and nothing gets created. Yet when I do "zip /home/brian/EOM01082008.ZIP /home/brian/EOM/01/*.M01" in the CLI it works.

Any idea?
Thanx in advance!

sbovisjb1
2nd October 2008, 05:43
Does your distro understand what a .zip is?

lsutiger2008
3rd October 2008, 01:30
Yet when I do "zip /home/brian/EOM01082008.ZIP /home/brian/EOM/01/*.M01" in the CLI it works.

Thanx for the reply!

falko
3rd October 2008, 05:09
Can you post the output of
ls -la /home/brian/EOM/01?
As what user do you run the script?

jacob martin
20th October 2008, 15:28
I am getting warnings when I build the install, and I've searched and it
appears that I can ignore them. I'm including them here, just in case that
is not true. I added Microsoft_VC80_ATL_x86.msm,
Microsoft_VC80_CRT_x86.msm, and Microsoft_VC80_MFC_x86.msm, and get warnings
about "Two or more objects have the same target location
('[payload_ul]\8.0.50727.762.policy')". I also have the ATL, CRT, and MFC
versions of policy_8_0_Microsoft_VC80_nnn_x86.msm which gives warnings about
"Two or more objects have the same target location
-----------------------------------------------------------------
Translation (http://www.all-translators.com/translation.php) Self Certification Mortgage Quotes (http://www.self-cert-mortgage-centre.co.uk/self-certification-mortgage-quotes.html)

akash011
6th November 2008, 11:35
I added Microsoft_VC80_ATL_x86.msm,
Microsoft_VC80_CRT_x86.msm, and Microsoft_VC80_MFC_x86.msm, and get warnings


and thanks to your post.