bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Directory creation/copy problem in Windows client


From: Mark . Burgess
Subject: Re: Directory creation/copy problem in Windows client
Date: Thu, 25 Apr 2002 10:25:08 +0200 (MET DST)

Now that you two are talking, please supply me with a new
patch for this. I have so many messages from the past 2 weeks
that I don't trust my ability to do the right thing.

Mark


On 24 Apr, Andrews, Martin wrote:
> David,
> 
> I am the source of the incomplete support for windows file paths. The
> directories were changed to '\' because I thought that made sense as the
> default separator but that does not help. cfengine used to always use '/',
> but I think you are right  - cfengine needs to preserve the original
> separator. Your fix seems okay - though why stick with the first file
> separator - you can forget the initial conditional and update
> Path_File_Separator at every node iteration. Does that seem right?
> 
> Martin
> 
> -----Original Message-----
> From: David Reiter [mailto:address@hidden
> Sent: Monday, April 22, 2002 8:05 PM
> To: address@hidden
> Subject: Directory creation/copy problem in Windows client
> 
> 
> Hi,
>  I am running into a problem when having cfengine copy over files
> in a directory from a linux box. My setup is the following:
> 
> I have a /var/cfengine/rpms directory on the linux box. I want
> any files that get put in that directory to be copied to the
> windows box. I added the following lines:
>  
> directories:
>  /var/cfengine/rpms
> 
> Then had lines in the copy: section to copy any changed files in
> /var/cfengine/rpms over. 
> 
> What would happen when I tried was I would get log messages
> saying creating directory /var/cfeninge/rpms then error
> messages saying it didn't exist. When I looked in the 
> filesystem (under cygwin) /var/cfengines/rpms was never created.
> So the rpms in the directory never got copied over. After doing
> some debugging I found out that it was actually creating 
> c:\var\cfeninge\rpms, but then trying to copy the rpm files
> to the cygwin /var/cfengine/rpms directory. 
> 
>  I traced the source of this problem to line 486 
>       *spc = FILE_SEPARATOR;
> For Windows FILE_SEPARATOR points to '\\' so as it was
> checking the directories in MakeDirectoriesFor it was
> using '\\' which then went out to the C: drive. I changed
> the logic to save the first separator as it was parsing the
> directory and use it as it created the dirs, which seems 
> to have fixed the problem.
> 
> insert at line 454:
> if (Path_File_Separator == '\0') Path_File_Separator = *sp;
> then change 486 to:
> *spc = Path_File_Separator;
> and declare the variable
> char Path_File_Separator='\0'; at the top of MakeDirectoriesFor()
> 
> Does this fix sound reasonable? Am I going to have problems with 
> other windows paths? Was there are specific reason the directories
> were being changed to \ ? Thanks for any information,
> 
> David.
> 
> 
> 
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-cfengine
> 
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-cfengine



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  address@hidden
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]