1. 05 Sep, 2019 2 commits
  2. 10 Oct, 2018 1 commit
    • LRN's avatar
      Straighten up the GFileType vs symlinks on Windows situation · 19608e36
      LRN authored
      On Windows NTFS symlinks are implemented as reparse points,
      which are special kinds of files *or directories*. A directory
      symlink should link to a directory. A file symlink should link
      to a file. Mismatching (such as a file symlink pointing to a
      directory) produces symlinks that simply do not function.
      
      Therefore GFileType file vs directory vs symlink distinction is
      too simplistic to correctly represent a NTFS filesystem object type.
      
      Since we can't turn back time and choose a better way of representing
      file types, make GFileType reflect the file vs directory type on
      Windows, meaning that all FS objects are either files or
      directories (or shortcuts, which are also files), but never symlinks.
      
      A test for symlinkiness will have to be made via GFileInfo - it
      tracks symlinkiness separately from file/directory/whatever.
      19608e36
  3. 12 Sep, 2018 3 commits
    • LRN's avatar
      Enable GIO tests on Windows · ad3694b8
      LRN authored
      1) Remove the non-Windows-only condition for subdir('tests').
      2) Add libiphlpapi, libws2_32 and libsecur32 deps, needed for W32 tests.
      3) Remove the -no-undefined argument (gcc doesn't understand it,
         it *does* understand -Wl,-no-undefined; either way, the test
         compiles without this argument just fine; maybe meson adds it
         by itself - you can hardly build shared modules without it).
      4) Add or fix a number of includes
      5) Disable gdbus-objectmanager tests when building with MSVC
         (right now these tests don't work on Windows anyway, so the fact
          that MSVC can't even build them properly is irrelevant;
          most likely gdbus-codegen needs changes to put _GLIB_EXTERN
          before each function)
      ad3694b8
    • LRN's avatar
      test_internal_enhanced_stdio: don't use g_assert() · 157dfc8a
      LRN authored
      g_assert() can be disabled, use more specific assertion macros.
      157dfc8a
    • LRN's avatar
      c24d3b0f
  4. 01 Nov, 2017 1 commit
    • LRN's avatar
      W32: Add a stat() implementation for private use · 53bd6a35
      LRN authored
      This commit adds new W32-only functions to gstdio.c,
      and a new header file, gstdioprivate.h.
      These functions are:
      g_win32_stat_utf8()
      g_win32_lstat_utf8()
      g_win32_fstat()
      and they fill a private structure, GWin32PrivateStat,
      which has all the fields that normal stat has, as well as some
      extras.
      
      These functions are then used throughout glib and gio to get better
      data about the system. Specifically:
      * Full, 64-bit size, guaranteed (g_stat() is forced to use 32-bit st_size)
      * Full, 64-bit file identifier (st_ino is 0 when normal stat() is used, and still is)
      * W32 File attributes (which stat() doesn't report); in particular, this allows
        symlinks to be correctly identified
      * Full, 64-bit time, guaranteed (g_stat() uses 32-bit st_*time on 32-bit Windows)
      * Allocated file size (as a W32 replacement for the missing st_blocks)
      
      st_mode remains unchanged (thus, no S_ISLNK), so when these are given back to
      glib users (via g_stat(), for example, which is now implemented by calling g_win32_stat_utf8),
      this field does not contain anything unexpected.
      
      g_lstat() now calls g_win32_lstat_utf8(), which works on symlinks the way it's supposed to.
      
      Also adds the g_win32_readlink_utf8() function, which behaves like readlink()
      (including its inability to return 0-terminated strings and inability to say how large
      the output buffer should be; these limitations are purely for compatibility with
      existing glib code).
      
      Thus, symlink support should now be much better, although far from being complete.
      
      A new W32-only test in gio/tests/file.c highlights the following features:
      * allocated size
      * 64-bit time
      * unique file IDs
      
      https://bugzilla.gnome.org/show_bug.cgi?id=788180
      53bd6a35
  5. 02 Jun, 2013 1 commit
  6. 16 Oct, 2012 1 commit
  7. 03 Sep, 2010 1 commit
    • Christian Persch's avatar
      Plug a mem leak in g-file-info test · d5d277dc
      Christian Persch authored
      ==2395== 64 bytes in 1 blocks are definitely lost in loss record 381 of 407
      ==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
      ==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
      ==2395==    by 0x40571A5: g_realloc (gmem.c:181)
      ==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
      ==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
      ==2395==    by 0x4199AA9: g_file_info_list_attributes (gfileinfo.c:646)
      ==2395==    by 0x80491CE: test_g_file_info (g-file-info.c:76)
      
      ==2395== 132 (64 direct, 68 indirect) bytes in 1 blocks are definitely lost in loss record 396 of 407
      ==2395==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
      ==2395==    by 0x4005C66: realloc (vg_replace_malloc.c:476)
      ==2395==    by 0x40571A5: g_realloc (gmem.c:181)
      ==2395==    by 0x401D670: g_ptr_array_maybe_expand (garray.c:968)
      ==2395==    by 0x401DD0B: g_ptr_array_add (garray.c:1225)
      ==2395==    by 0x4199A82: g_file_info_list_attributes (gfileinfo.c:642)
      ==2395==    by 0x80492B7: test_g_file_info (g-file-info.c:86)
      
      Bug #628331.
      d5d277dc
  8. 06 Jul, 2009 1 commit
  9. 01 Jul, 2009 1 commit
  10. 28 May, 2008 1 commit
    • Michael Natterer's avatar
      don't define G_DISABLE_SINGLE_INCLUDES, it's in the global CPPFLAGS now. · 03a5797a
      Michael Natterer authored
      2008-05-28  Michael Natterer  <mitch@imendio.com>
      
      	* Makefile.am: don't define G_DISABLE_SINGLE_INCLUDES, it's in
      	the global CPPFLAGS now.
      
      	* tests/data-input-stream.c
      	* tests/data-output-stream.c
      	* tests/g-file-info.c
      	* tests/g-file.c
      	* tests/live-g-file.c
      	* tests/memory-input-stream.c: don't include <glib/gtestutils.h>
      
      
      svn path=/trunk/; revision=6954
      03a5797a
  11. 27 May, 2008 1 commit
  12. 26 May, 2008 1 commit
  13. 22 Jan, 2008 1 commit
    • Alexander Larsson's avatar
      Allow UTF-8 in file:// parse names. · b784923e
      Alexander Larsson authored
      2008-01-22  Alexander Larsson  <alexl@redhat.com>
      
              * glocalfile.c:
      	Allow UTF-8 in file:// parse names.
      	
              * tests/Makefile.am:
              * tests/data-input-stream.c:
              * tests/data-output-stream.c:
              * tests/g-file-info.c:
              * tests/g-file.c:
      	Added a bunch of tests from Tomas Bzatek
      
      
      svn path=/trunk/; revision=6351
      b784923e