getattr.c (1481B)
1 /* 2 This file is part of gnunet-fuse. 3 Copyright (C) 2012 GNUnet e.V. 4 5 gnunet-fuse is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published 7 by the Free Software Foundation; either version 3, or (at your 8 option) any later version. 9 10 gnunet-fuse is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 19 */ 20 /* 21 * getattr.c - FUSE getattr function 22 * 23 * Created on: Mar 14, 2012 24 * Author: mg 25 * 26 * 27 * Get file attributes. 28 * 29 * Similar to stat(). The 'st_dev' and 'st_blksize' fields are 30 * ignored. The 'st_ino' field is ignored except if the 'use_ino' 31 * mount option is given. 32 */ 33 /** 34 * @file fuse/getattr.c 35 * @brief 'stat' for fuse files 36 * @author Christian Grothoff 37 */ 38 39 #include "gnunet-fuse.h" 40 #include "gfs_download.h" 41 42 int 43 gn_getattr (const char *path, struct stat *stbuf) 44 { 45 struct GNUNET_FUSE_PathInfo *pi; 46 int eno; 47 48 pi = GNUNET_FUSE_path_info_get (path, &eno); 49 if (NULL == pi) 50 return - eno; 51 *stbuf = pi->stbuf; 52 GNUNET_FUSE_path_info_done (pi); 53 return 0; 54 } 55 56 /* end of getattr.c */ 57