Remove some duplicate code
This commit is contained in:
		
							parent
							
								
									c08c802bf3
								
							
						
					
					
						commit
						3f8576a6ab
					
				
					 4 changed files with 22 additions and 21 deletions
				
			
		|  | @ -227,6 +227,16 @@ DirEntries readDirectory(const Path & path) | |||
| } | ||||
| 
 | ||||
| 
 | ||||
| unsigned char getFileType(const Path & path) | ||||
| { | ||||
|     struct stat st = lstat(path); | ||||
|     if (S_ISDIR(st.st_mode)) return DT_DIR; | ||||
|     if (S_ISLNK(st.st_mode)) return DT_LNK; | ||||
|     if (S_ISREG(st.st_mode)) return DT_REG; | ||||
|     return DT_UNKNOWN; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| string readFile(int fd) | ||||
| { | ||||
|     struct stat st; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue