file-attributes

Python documentation for os.removexattr — what does the '*' (star) argument mean?

那年仲夏 提交于 2020-01-21 12:05:21
问题 My first question, please be gentle. I searched but could not find an answer here or elsewhere. Note that this question does not apply to unpacking of arguments like *args. In the python 3.3 documentation for os.removexattr the following is stated: os.removexattr(path, attribute, *, follow_symlinks=True) Removes the extended filesystem attribute attribute from path. attribute should be bytes or str. If it is a string, it is encoded with the filesystem encoding. This function can support

Python documentation for os.removexattr — what does the '*' (star) argument mean?

被刻印的时光 ゝ 提交于 2020-01-21 12:05:06
问题 My first question, please be gentle. I searched but could not find an answer here or elsewhere. Note that this question does not apply to unpacking of arguments like *args. In the python 3.3 documentation for os.removexattr the following is stated: os.removexattr(path, attribute, *, follow_symlinks=True) Removes the extended filesystem attribute attribute from path. attribute should be bytes or str. If it is a string, it is encoded with the filesystem encoding. This function can support

Extracted Files are always read-only

巧了我就是萌 提交于 2020-01-16 18:20:23
问题 I'm extracting an ISO and then copying a folder from the extracted ISO. The problem is that the extracted files are read-only. I've tried changing it from the properties menu, and from code in c#. Neither worked. The code I used for extracting the ISO is in another question: extract ISO with winrar automatically with c# or batch I'm looking for a way to either change the attributes of the extracted ISO so that I can copy from its subfolders, or to just change the sub folders permissons.

How FileAttributes.Encrypted work in C#?

半世苍凉 提交于 2020-01-13 02:06:38
问题 I didn't find any example on google... Can anyone show how it works? And when folders and files will be encrypted how to decrypt them? Link: FileAttributes Enumeration 回答1: The FileAttributes.Encrypted flag tells you whether a file or folder has been encrypted by the NTFS file system. This option is available to users by right-clicking a file, selecting Properties, then clicking the Advanced button. There is an option "Encrypt contents to secure data" which is what the FileAttributes

How FileAttributes.Encrypted work in C#?

别说谁变了你拦得住时间么 提交于 2020-01-13 02:06:37
问题 I didn't find any example on google... Can anyone show how it works? And when folders and files will be encrypted how to decrypt them? Link: FileAttributes Enumeration 回答1: The FileAttributes.Encrypted flag tells you whether a file or folder has been encrypted by the NTFS file system. This option is available to users by right-clicking a file, selecting Properties, then clicking the Advanced button. There is an option "Encrypt contents to secure data" which is what the FileAttributes

Checking if a Folder/File is Hidden/System in Windows C/C++

混江龙づ霸主 提交于 2020-01-03 19:31:34
问题 I am writing a Cross platform application using C++/STL/Boost and I realized they do not provide a way to check if a folder or file is hidden or is a system file in Windows. What's the simplest way to do this in C/C++ for Windows ? Ideally I have a std::string with the path (either to a file or folder), and would return if it's hidden or is a system file. best if it works across all windows versions. I am using MinGW g++ to compile this as well. 回答1: GetFileAttributes will work for this. It

Writing Spotlight metadata to files on OS X (specifically kMDItemDisplayName)

心已入冬 提交于 2020-01-01 17:08:11
问题 I see that this has been answered previously by Ken T., but I have a case where the code appears to work, and the call to setxattr() returns 0, but the item I want to modify does not change. Specifically, I'm trying to change the metadata attribute kMDItemDisplayName, and my call looks like this (modeled after the sample posted by Ken T): [Note: the "name" param below is an NSString *] rc = setxattr([pathString cStringUsingEncoding:NSUTF8StringEncoding], "kMDItemDisplayName", [name

Obtain last modification date/time of file as local date/time string

落爺英雄遲暮 提交于 2020-01-01 12:26:08
问题 new File(url).lastModified() returns a long equal to the number of milliseconds since the epoch, which is GMT-based. What is a simple way to convert this to a String representing system-local date/time? If you really need to see an attempt from me here it is but it's a terrible mess and it's wrong anyway: LocalDateTime.ofEpochSecond(new File(url).lastModified()/1000,0,ZoneOffset.UTC).atZone(ZoneId.of("UTC")).format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG)) Beyond LocalDateTime

Symlink with Files.createSymbolicLink (Java 7) in RHEL 5

与世无争的帅哥 提交于 2019-12-25 05:27:20
问题 I want to create a symlink in RHEL 5 using Java. In java6 createSymbolicLink have only two parameters. But in case of Java7 FileAttribute has been included along with the parameters, ie a total of three parameters. public static Path createSymbolicLink(Path link, Path target, FileAttribute... attrs) throws IOException Creates a symbolic link to a target (optional operation). The target parameter is the target of the link. It may be an absolute or relative path and may not exist. When the

Git on Windows and file attributes

百般思念 提交于 2019-12-23 07:20:26
问题 I noticed that when you commit or checkout files using Git in a Windows environment, the file attributes are not preserved (for example hidden or read-only). If I commit a hidden file and then I check it out on another computer, the file is no more hidden. Is it possible to make Git recognize Windows file attributes? Thanks. 回答1: No. Git doesn't track full UNIX permissions either, it just remembers the executable bit for convenience. As to why — it's a version control system, designed to