!                                                                             
00010 REM "PJPXFD - Get a UNIX File's Moded using XFD"                        
00020 REM "  Hierarichal Directorty Required"                                 
00050 BEGIN                                                                   
00100 INPUT "Enter UNIX filename w/ full path: ",FILE$                        
00110 OPEN(1) FILE$                                                           
00120 DIM PROT$[7]                                                            
00130 GOSUB 5000                                                              
00140 PRINT                                                                   
00150 PRINT "UNIX mode: "                                                     
00160 SYSTEM "ls -l " + FILE$          ! Show Permissions in UNIX             
00170 PRINT                                                                   
00180 PRINT "XFD mode: "                                                      
00190 STAT$=XFD(1,0)                   ! Get the XFD for Open File            
00200 MODE = DEC (STAT$(36,2))         ! Get the mode info from XFD           
00210 MODE$ = "-"                      ! First byte unused for Permissions    
00220 MODE$ = MODE$ + PROT$[INT(MODE/64)] ! Change DECimal numer to OCTal     
00230 MODE = MOD (MODE,64)                                                    
00240 MODE$ = MODE$ + PROT$[INT(MODE/8)]                                      
00250 MODE$ = MODE$ + PROT$[MOD(MODE,8)]  ! Done with Octal Conversion        
00260 PRINT MODE$                      ! Show Results in Terms of "rwx"       
00999 END                                                                     
05000 REM                                                                     
05010 PROT$[0] = "---"                 ! Map Octal numbers to "rwx"  equivs.  
05020 PROT$[1] = "--x"                 ! Stolen from GAT's FIX269 program!    
05030 PROT$[2] = "-w-"                                                        
05040 PROT$[3] = "-wx"                                                        
05050 PROT$[4] = "r--"                                                        
05060 PROT$[5] = "r-x"                                                        
05070 PROT$[6] = "rw-"                                                        
05080 PROT$[7] = "rwx"                                                        
05999 RETURN