file-attributes

Testing for file attribute in batch file

Hi, I'm writing a batch file and I need to know if a file is read only. How can I do that ? I know how to get them using the %~a modifier but I don't know what to do with this output. It gives something like -ra------. How can I parse this in batch file ? ...

Keep Attributes of Version Controlled Files Unchanged

Is it possible to keep the attributes of a version controlled file unchanged? I have a directory structure which I'd like my installer to recreate on the client machine. I was hoping the entire directory could be placed on VCS without affecting the file attributes. I'm using TFS but would also like to hear about other version control sy...

How to get the modified time attribute of a certain file on FTP

I need to monitor a certain file on FTP, once it had been updated, I need to fetch it from FTP. but how to identify whether it's updated or not is a problem. Does Anybody have any experience on this? ...

An XML language for describing file attributes of a directory tree?

I have an application in mind which will record directory listings of a file system in text form. That is, it should say something like: File name is: abc.txt Last modification date is: 2009-12-31T01:23 Read-only attribute is: True Hidden attribute is: False The listings will persist for years in a long-term archive, so the language s...

Unknown FileAttributes

I tried to run the following code: var top = new DirectoryInfo("C:\\"); foreach(var info in top.GetFileSystemInfos()) System.Console.WriteLine("{0}: {1}", info.Name, info.Attributes); I got the following result: $Recycle.Bin: Hidden, System, Directory ATI: Directory Documents and Settings: Hidden, System, Directory, Repars...

Strange attribute value reported by FindFirst(), Attr = 2080

When searching for files with FindFirst() I get an attribute value in the TSearchRec.Attr field of 2080. It is not specified in the help as there are only these values available and no combination of them yields 2080: 1 faReadOnly 2 faHidden 4 faSysFile 8 faVolumeID 16 faDirectory 32 faArchive 64 faSymLink 71 faAnyFile Does anyone kn...

What is the best pratice to get a file attribute(such as read only), and security attribute(such as read deny write deny)?

I am programming in C++ MFC, windows. What is the best practice to get a file attribute(such as read only), and security attribute(such as read deny write deny) in windows XP, Vista, and Win7? and What is the best practice to modify a file attribuute and security attribute? Many thanks!!! ...

Delete link to file without clearing readonly bit

I have a set of files with multiple links to them. The files are owned by TFS source control but other links to them are made to them. How do I delete the additional links without clearing the readonly bit. It's safe to assume: The files have more than one link to them You are not deleting the name owned by TFS There are no potential...

Finding the attributes of Chinese filenames using NewLISP?

The following NewLISP code shows me the file attributes of files under Win32. However, some of the filenames retrieved have Chinese characters in the name. When the GetFileAttributesA function encounters them, it gives me a -1 for the attribute. I looked at GetFileAttributesW but don't know how to make the contents of the fname available...

c# check if a directory is hidden?

Possible Duplicate: How to test if directory is hidden in C#? DirectoryInfo dir = new DirectoryInfo(@"c:\test"); if ((dir.Attributes & FileAttributes.Hidden) == (FileAttributes.Hidden)) { //do stuff } With this if statement i would like to test if the directory is hidden. Although the directory really is hidden, my pr...