It is currently Wed Jun 19, 2013 8:58 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 12:43 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 276
Location: Nottinghamshire UK
Hi All

I have a problem where i have a file supposedly in a directory, but windows fails to see it ie explorer.exe i have ran ubuntu 10.10 live cd and ubuntu failed to see it also :O allthough each time i run any routine or program created by pb that i have it see`s the file "NFC.xml". so i wrote

Code:
Directory$ = "C:\Program Files (x86)\Anywhere Software\Basic4android\Libraries\"
If ExamineDirectory(0, Directory$, "*.*") 
   While NextDirectoryEntry(0)
      If DirectoryEntryType(0) = #PB_DirectoryEntry_File
         FileAttributes = DirectoryEntryAttributes(0)
         If FileAttributes <>32
            Debug "This file is hidden   "+ DirectoryEntryName(0)+"  "+ Str(FileAttributes)
         EndIf
         Debug DirectoryEntryName(0) + "      "+Str(FileAttributes)
         Debug ""
      EndIf
   Wend
   FinishDirectory(0)
EndIf


this see`s the file and identifies the attributes of "NFC.xml" as 65568 where all the other files are 32 and all otherfiles are visible ?

any help idea would be appreciated

zebuddi


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 1:14 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2919
Location: Wales, UK
Can you open the file in an editor?

A 'normal' hidden read-write file would have an attribute of 34 (on Win32). If you do a Google search, 65568 has a long list but I have no idea why you see that attribute number - perhaps you could link to the file so that others can verify it on their system?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 1:23 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 2269
Location: Italy
Shot version: I don't have a clue.

Long version:

On PB the documented return values are

#PB_FileSystem_Hidden : File is hidden
#PB_FileSystem_Archive : File has been archived and not changed since the last time
#PB_FileSystem_Compressed: File is compressed
#PB_FileSystem_Normal : Normal attributes
#PB_FileSystem_ReadOnly : File is in readonly mode
#PB_FileSystem_System : File is a system file

and even adding the undocumented ones (but available in the winapi) you got this:

Code:
Debug #PB_FileSystem_ReadOnly 
Debug #PB_FileSystem_Hidden   
Debug #PB_FileSystem_System   
Debug #PB_FileSystem_Archive   
Debug #PB_FileSystem_Normal   
Debug #FILE_ATTRIBUTE_TEMPORARY
Debug #FILE_ATTRIBUTE_SPARSE_FILE
Debug #FILE_ATTRIBUTE_REPARSE_POINT
Debug #PB_FileSystem_Compressed
Debug #FILE_ATTRIBUTE_OFFLINE
Debug #FILE_ATTRIBUTE_ENCRYPTED


all numbers between 1 and 16384, so I don't have idea why you get such a large value, maybe some attribute flag I don't know about ?

Hopefully someone else will give you a better answer.

_________________
[ Home ] [ My PC ] [ New to PB ? ]


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 5:35 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Aug 15, 2009 6:59 pm
Posts: 1029
Sounds like a error in the file system. Try run Scandisk or another tool that searches disk errors.


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 6:33 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Mar 09, 2006 9:24 am
Posts: 195
Location: S. Kor
http://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx

Quote:
FILE_ATTRIBUTE_VIRTUAL
65536 (0x10000)

This value is reserved for system use.


maybe #FILE_ATTRIBUTE_VIRTUAL|#FILE_ATTRIBUTE_ARCHIVE = 65568 ?


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 8:16 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 276
Location: Nottinghamshire UK
Thanks Luis, IdeasVacuum, Thorium, breeze4me for the reply's

I copied the NFC.xml & NFC.jar into the folder to overwrite anything that might be there DirectoryEntryAttributes() still showed NFC.xml 65568 and NFC.jar 32
both files where visible in explorer after

did a shift Delete on the whole folder reinstalled b4a (Basic4Android) installing standard libs ran the program i have written to install new libs for b4a from zip files installed NFC.xml .

ran DirectoryEntryAttributes() and all is ok NFC.xml = 32 and visible through explorer.exe. Very strange. that even after reboot and running ubuntu 10.10 live cd
that neither linux nor win os could not see the file. but PB does !!! and pull attributes

So the return from DirectoryEntryAttributes() is OR`ed ? is this correct

Thanks
zebuddi


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 8:21 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 2269
Location: Italy
@Zebuddi123

Yes, the flags are OR'ed to make the final value.

@breeze4me

Ah, interesting never saw that value, thanks !

_________________
[ Home ] [ My PC ] [ New to PB ? ]


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 8:37 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 2269
Location: Italy
FILE_ATTRIBUTE_VIRTUAL

it seem to have to do with the file virtualization introduced with Window Vista.

Since the file was under "C:\Program Files (x86)\" maybe it was not really written there but somewhere else and "virtualized", hence the attribute, this would explain why a live linux cd didn't see the file there.

Or something like that :)

See "File Virtualization" http://msdn.microsoft.com/en-us/library/bb756960.aspx

_________________
[ Home ] [ My PC ] [ New to PB ? ]


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 8:56 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 276
Location: Nottinghamshire UK
luis

think you`ve hit the nail on the head. i remember searching for NFC.xml via "everything search engine" and it pulling up something with a virtual in the directory path name did`nt take much notice of it

but found C:\Users\zebuddi\AppData\Local\VirtualStore\Program Files (x86)\Anywhere Software\Basic4android\Libraries\NFC.xml

what do you think ?

looks like it could be the case and the file returns 32 from that directory

yes it is !!!

just made sure that the NFC.xml file did not exist in c:\Program Files (x86)\Anywhere Software\Basic4android\Libraries\ but it exists in C:\Users\zebuddi\AppData\Local\VirtualStore\Program Files (x86)\Anywhere Software\Basic4android\Libraries\ and returns 65568

Deleted C:\Users\zebuddi\AppData\Local\VirtualStore\Program Files (x86)\Anywhere Software\Basic4android\Libraries\NFC.xml ran test file does not exist

So riddle Solved :)


Thanks :D
Zebuddi


Last edited by Zebuddi123 on Sat Feb 18, 2012 9:05 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sat Feb 18, 2012 9:02 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 2269
Location: Italy
That's it.

Thanks to breeze4me for pointing out the existence of the flag :)

_________________
[ Home ] [ My PC ] [ New to PB ? ]


Top
 Profile  
 
 Post subject: Re: DirectoryEntryAttribute(0) returns 65568
PostPosted: Sun Feb 19, 2012 7:07 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Feb 01, 2012 3:30 pm
Posts: 276
Location: Nottinghamshire UK
What was happening is that if your program does not have administrative rights to install files other than in public user space. a virtual directory is created in
C:\Users\zebuddi\AppData\Local\VirtualStore + appendage ie C:\Users\zebuddi\AppData\Local\VirtualStore + \Pragram Files x86\purebasic\libraries which would be a direct reflection of the directory path of the program you are using \ writiing too etc.

because this is a virtual path the file attributes assigned to the file returns 65586 which is OR`ed from a combination of available attributes as pointed out by ourgreat community

so in summary if you program insists that it has written a file to a specified directory but you know its not there check for admin rights if they are not selected in compiler options then they most likely have been written to C:\Users\zebuddi\AppData\Local\VirtualStore + appendage

Hope this helps if you run into this little riddle in the future

Thanks to the community

Zebuddi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye