C# program not acting right

Discussion in 'Programming/Scripts' started by lsutiger2008, Sep 10, 2008.

  1. lsutiger2008

    lsutiger2008 New Member

    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 code
    Code:
    strArgs = 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:
    Code:
    /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!
     
  2. sbovisjb1

    sbovisjb1 Member HowtoForge Supporter

    Does your distro understand what a .zip is?
     
  3. lsutiger2008

    lsutiger2008 New Member

    Yeppers

    Thanx for the reply!
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Can you post the output of
    Code:
    ls -la /home/brian/EOM/01
    ?
    As what user do you run the script?
     
  5. jacob martin

    jacob martin New Member

    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 Self Certification Mortgage Quotes
     
  6. akash011

    akash011 New Member

    thanks for information

    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.
     

Share This Page