search for: srcstat

Displaying 8 results from an estimated 8 matches for "srcstat".

2019 Aug 09
0
[PATCH] Switch to utimensat for newer POSIX versions
...ors of BSD (like OS X) require this to get time_t */ -#include <utime.h> /* for utime() */ #endif #if defined __EMX__ #include <io.h> /* for setmode(), O_BINARY */ @@ -53,11 +52,17 @@ void grabbag__file_copy_metadata(const char *srcpath, const char *destpath) { struct flac_stat_s srcstat; - struct utimbuf srctime; if(0 == flac_stat(srcpath, &srcstat)) { +#if _POSIX_C_SOURCE >= 200809L + struct timespec srctime[2] = {}; + srctime[0].tv_sec = srcstat.st_atime; + srctime[1].tv_sec = srcstat.st_mtime; +#else + struct utimbuf srctime; srctime.actime = srcstat.st_atime;...
2014 Jan 13
0
[PATCH] New API: copy-attributes.
...quot; GUESTFSD_EXT_CMD(str_file, file); GUESTFSD_EXT_CMD(str_zcat, zcat); @@ -584,3 +585,74 @@ do_filesize (const char *path) return buf.st_size; } + +int +do_copy_attributes (const char *src, const char *dest, int all, int mode, int xattributes, int ownership) +{ + int r; + struct stat srcstat, deststat; + + static const unsigned int file_mask = 07777; + + /* If it was specified to copy everything, manually enable all the flags + * not manually specified to avoid checking for flag || all everytime. + */ + if (all) { + if (!(optargs_bitmask & GUESTFS_COPY_ATTRIBUTES_MODE_BIT...
2014 Jan 07
8
RFC: copy-attributes command
Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a "file" to another, so for example in guestfish: copy-attributes foo bar permissions:true xattributes:false would only copy the permissions of foo to bar, not copying its extended attributes too. Just few notes: - my first daemon command, so
2014 Jan 07
0
Re: RFC: copy-attributes command
...le); > GUESTFSD_EXT_CMD(str_zcat, zcat); > @@ -584,3 +585,46 @@ do_filesize (const char *path) > > return buf.st_size; > } > + > +int > +do_copy_attributes (const char *src, const char *dest, int permissions, int xattributes) > +{ > + int r; > + struct stat srcstat, deststat; > + > + CHROOT_IN; > + r = stat (src, &srcstat); > + CHROOT_OUT; > + > + if (r == -1) { > + reply_with_perror ("stat: %s", src); > + return -1; > + } > + > + CHROOT_IN; > + r = stat (dest, &deststat); > + CHROOT_OUT;...
2006 Oct 09
1
Not fail if can't set permissions ?
...but it complicates error detection on my end. Is there a way to make rsync not consider it an error when chmod() fails on a directory owned by someone else ? Possibly warn about it, but still exit with a zero status. stat (destpathname, &deststat); if ((deststat.st_mode & mask) != (srcstat.st_mode & mask)) { if (chmod (pathname, srcstat.st_mode) != 0) { if (errno == EPERM && deststat.st_uid != geteuid () && option_ignore_non_owner) { /* Expected error - just warn about it */ ; } else { /* Unexpected error - fail *...
2014 Jan 10
4
Re: RFC: copy-attributes command
...@@ do_filesize (const char *path) > > > > return buf.st_size; > > > > } > > > > + > > +int > > +do_copy_attributes (const char *src, const char *dest, int > > permissions, int xattributes) +{ > > + int r; > > + struct stat srcstat, deststat; > > + > > + CHROOT_IN; > > + r = stat (src, &srcstat); > > + CHROOT_OUT; > > + > > + if (r == -1) { > > + reply_with_perror ("stat: %s", src); > > + return -1; > > + } > > + > > + CHROOT_IN; >...
2013 Apr 01
1
flac 1.3.0pre3 pre-release
...utf8_io.h:23:43: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] flac-1.3.0pre3/src/share/grabbag/file.c: In function 'grabbag__file_copy_metadata': flac-1.3.0pre3/src/share/grabbag/file.c:53:21: error: storage size of 'srcstat' isn't known AFAIU, mingw.org headers don't have _stat64 struct at all, they have __stat64 instead. _stat64 is from mingw-w64 headers (mingw-w64 has a #define __stat64 _stat64, so using __stat64 should work). You also need to define __MSVCRT_VERSION__=0x0601, because that is the condi...
2013 Apr 01
17
flac 1.3.0pre3 pre-release
Hi all, The latest pre-release is here: http://downloads.xiph.org/releases/flac/beta/flac-1.3.0pre3.tar.xz but there will probably need to be at least one more. I've tested this on x86_64-linux powerpc-linux i386-openbsd5.2 i386-freebsd9 The majority of changes since the last pre-release is the addition of Janne Hyv?rinen's utf8 I/O functionality. Janne's