Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1. michael@x071:[/home/michael]ls -lia /tmp | head
  2. total 287464
  3. 2 drwxrwxrwt 54 bin bin 36864 Jan 22 13:35 .
  4. 2 drwxr-xr-x 39 root system 4096 Jan 5 12:27 ..
  5. 5 drwxrwxrwt 2 root system 256 May 8 2013 .X11-unix
  6. 6 -rw-r----- 1 root system 0 May 23 2014 .ahafs.out.michael.10223652
  7. 7 -rw-r----- 1 root system 0 May 23 2014 .ahafs.out.michael.9502870
  8. 8 -r--r--r-- 1 root system 25 Jun 9 2013 .aix_ISMP_lock____.save
  9. 9 drwxrwxrwt 3 root system 4096 Dec 27 12:15 .com_ibm_tools_attach
  10. 62 -rw-r--r-- 1 root system 3124 Dec 27 11:21 .ctinst.log
  11. 63 -rw-r----- 1 michael felt 2578 Aug 16 2013 .htaccess
  12.  
  13. michael@x071:[/home/michael]od -dc /tmp | head -20
  14. 0000000 2 11776 0 0 0 0 0 0
  15. 002 .
  16. 0000020 2 11822 0 0 0 0 0 0
  17. 002 . .
  18. 0000040 32848 11895 28530 27492 26994 11825 13109 13878
  19. 200 P . w o r k d i r . 1 3 5 6 6
  20. 0000060 5 11864 12593 11637 28265 30720 0 0
  21. 005 . X 1 1 - u n i x
  22. 0000100 6 11873 26721 26227 11887 30068 11885 26979
  23. 006 . a h a f s . o u t . m i c
  24. 0000120 7 11873 26721 26227 11887 30068 11885 26979
  25. a . a h a f s . o u t . m i c
  26. 0000140 8 11873 27000 24393 21325 20575 27759 25451
  27. b . a i x _ I S M P _ l o c k
  28. 0000160 9 11875 28525 24425 25197 24436 28527 27763
  29. t . c o m _ i b m _ t o o l s
  30. 0000200 62 11875 29801 28275 29742 27759 26368 0
  31. > . c t i n s t . l o g
  32. 0000220 63 11880 29793 25443 25971 29440 0 0
  33. ? . h t a c c e s s
  34.  
  35. michael@x067:~$ od -dc /tmp|head
  36. od: /tmp: read error: Is a directory
  37. 0000000
  38.  
  39. #define _D_NAME_MAX 255
  40.  
  41. struct dirent {
  42. __ulong64_t d_offset; /* real off after this entry */
  43. ino_t d_ino; /* inode number of entry */
  44. ushort_t d_reclen; /* length of this record */
  45. ushort_t d_namlen; /* length of string in d_name */
  46. char d_name[_D_NAME_MAX+1]; /* name must be no longer than this */
  47. /* redefine w/#define when name decided */
  48. };
  49.  
  50. struct dirent
  51. {
  52. #ifndef __USE_FILE_OFFSET64
  53. __ino_t d_ino;
  54. __off_t d_off;
  55. #else
  56. __ino64_t d_ino;
  57. __off64_t d_off;
  58. #endif
  59. unsigned short int d_reclen;
  60. unsigned char d_type;
  61. char d_name[256]; /* We must not include limits.h! */
  62. };
  63.  
  64. /usr/include/dirent.h:
  65. /* This is the data type of directory stream objects.
  66. The actual structure is opaque to users. */
  67. typedef struct __dirstream DIR;
  68.  
  69. extern DIR *opendir (__const char *__name) __nonnull ((1));
  70. ...
  71. /* Read a directory entry from DIRP. Return a pointer to a `struct
  72. dirent' describing the entry, or NULL for EOF or error. The
  73. storage returned may be overwritten by a later readdir call on the
  74. same DIR stream.
  75.  
  76. If the Large File Support API is selected we have to use the
  77. appropriate interface.
  78.  
  79. This function is a possible cancellation point and therefore not
  80. marked with __THROW. */
  81. #ifndef __USE_FILE_OFFSET64
  82. extern struct dirent *readdir (DIR *__dirp) __nonnull ((1));
  83. #else
  84. # ifdef __REDIRECT
  85. extern struct dirent *__REDIRECT (readdir, (DIR *__dirp), readdir64)
  86. __nonnull ((1));
  87. # else
  88. # define readdir readdir64
  89. # endif
  90. #endif
  91.  
  92. #ifdef __USE_LARGEFILE64
  93. extern struct dirent64 *readdir64 (DIR *__dirp) __nonnull ((1));
  94. #endif
  95.  
  96. /*
  97. * Definitions for library routines operating on directories.
  98. */
  99. typedef struct _dirdesc {
  100. #ifdef _ALL_SOURCE
  101. int dd_fd; /* file descriptor of directory */
  102. blksize_t dd_blksize; /* this filesystem's block size */
  103. char *dd_buf; /* malloc'd buffer depending of fs bsize */
  104. long dd_size; /* size of buffer */
  105. long dd_flag; /* private flags for readdir, unused */
  106. off_t dd_loc; /* logical(dirent) offset in directory */
  107. off_t dd_curoff; /* real offset in directory corresponding
  108. * to dd_loc */
  109. #else
  110. int __dd_fd; /* file descriptor of directory */
  111. blksize_t __dd_blksize; /* this filesystem's block size */
  112. char *__dd_buf; /* malloc'd buffer depending of fs bsize */
  113. long __dd_size; /* size of buffer */
  114. long __dd_flag; /* private flags for readdir, unused */
  115. off_t __dd_loc; /* logical(dirent) offset in directory */
  116. off_t __dd_curoff; /* real offset in directory corresponding
  117. * to dd_loc */
  118. #endif
  119. #if defined(_THREAD_SAFE) && defined(_ALL_SOURCE)
  120. void *dd_lock; /* for inter-thread locking */
  121. #endif
  122.  
  123. } DIR;
  124.  
  125. ...
  126.  
  127. extern DIR *opendir(const char *);
  128. extern struct dirent *readdir(DIR *);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement