我的应用程序有一个文件夹,全部标记为"隐藏"(包括文件夹本身).但是,除非我先删除"隐藏"属性,否则Inno安装程序不会复制它们进行安装.
很公平,但有没有办法让Inno Setup在我最终用户的机器上完成设置后将已安装的文件夹标记为"隐藏"?
谢谢.
请告诉我一个可用于更改文件属性的 MSYS shell 命令。当我运行命令时,ls -l我得到以下信息:
-rw-r--r-- 1 lenovo Admin .....m4sugar.m4
Run Code Online (Sandbox Code Playgroud)
我想提供完整的访问权限。
非常感谢任何帮助。
谢谢
简单的例子:
tar cf <archive_name> <file_name>
md5sum <archive_name>
touch <file_name>
tar cf <archive_name> <file_name>
md5sum <archive_name>
Run Code Online (Sandbox Code Playgroud)
md5sum 的结果不同。
如何避免这种情况?
我期望这段代码:
if (!File.Exists(fullFileName))
{
File.Create(fullFileName);
}
File.SetAttributes(fullFileName, FileAttributes.Compressed);
Run Code Online (Sandbox Code Playgroud)
要设置此标志:

但它不...我做错了什么?如何在文件上设置该标志?
更新:文档中说
“无法使用 SetAttributes 方法更改 File 对象的压缩状态。”
显然,使用静态 File.SetAttributes 时它也不起作用。
鉴于此,如何才能实现这一目标呢?
我找到了一些Linux文件,当我输入时ls -lah,它会输出以下权限格式:
...
drwxr-xr-x. 2 root root
...
-rw-rw-r--. 1 root root
...
Run Code Online (Sandbox Code Playgroud)
我想知道在权限格式结束时dot(-rw-rw-r--.)的含义是什么?
我正在使用C++/STL/Boost编写一个跨平台应用程序,我意识到它们没有提供检查文件夹或文件是否被隐藏或是否是Windows中的系统文件的方法.
在C/C++ for Windows中执行此操作的最简单方法是什么?
理想情况下,我有一个std :: string与路径(文件或文件夹),如果它被隐藏或是系统文件将返回.最好,如果它适用于所有Windows版本.我正在使用MinGW g ++来编译它.
当使用FindFirst()搜索文件时,我在TSearchRec.Attr字段2080中获得了一个属性值.它没有在帮助中指定,因为只有这些值可用,并且它们的组合没有产生2080:
1 faReadOnly
2 faHidden
4 faSysFile
8 faVolumeID
16 faDirectory
32 faArchive
64 faSymLink
71 faAnyFile
有谁知道2080意味着什么以及为什么我得到那个属性值?操作系统是嵌入式XP.
使用Windows资源管理器查看文件时,我可以选择设置"标记","类别"或其他属性.对于JPEG,可以选择不同的属性集(包括"标记").我希望能够以编程方式设置这些.
如何使用Delphi(我有Delphi 2010 Pro)以编程方式设置文件标签和其他文件属性?
我正在从我的服务器下载一个文件(我只获取最后写入时间属性的字节和日期时间),下载数据后我在本地计算机上创建一个新文件并想要设置最后写入时间属性。为此,我使用以下方法:
procedure SetFileDate(const FileName: string; NewDate: TDateTime);
var
FileDate, FileHandle: Integer;
begin
try
FileDate := DateTimeToFileDate(NewDate);
FileHandle := FileOpen(FileName, fmOpenReadWrite or fmShareDenyWrite);
if FileHandle > 0 then
begin
FileSetDate(FileHandle, FileDate);
FileClose(FileHandle);
end;
except
begin
// ERROR Log
err.Msg('FileReqThrd.SetFileDate');
end;
end;
end;
Run Code Online (Sandbox Code Playgroud)
对于“NewDate”参数,我使用从服务器获取的日期时间。我尝试像这样从服务器转换 DateTime 以获取有效的最后写入时间(我正在从 WCF 请求数据,这就是为什么我将其转换为 UTCDateTime,来自 WCF 服务的未更改数据是 TXSDateTime):
TDateTime cloudFileDateTime := StrToDateTime(DateTimeToStr(cloudDownloadResult.FileCloudData.Lastwritetime.AsUTCDateTime));
Run Code Online (Sandbox Code Playgroud)
但最终我的lastwritetime属性在冬季期间具有lastwritetime的文件是错误的-1h。
我希望您理解我的问题并能给我一个如何解决它的想法。
此致
我是Swift的新手,我正在尝试实现文件创建日期检查.
我们的想法是检查文件的创建时间是否超过7天.由于某种原因,代码总是返回"没有这样的文件"错误.
为了检查什么是错误,我使用相同的路径来读取同一功能中的文件内容,并且完美无缺.
我错误地使用了路径还是误解了某些东西?
func creationDateCheck(name: String) -> Bool {
// This is the path I am using, file is in the favorites folder in the .documentsDirectory
let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
let myFilesPath = documentsUrl.appendingPathComponent("favorites/" + name + ".xml")
let pathString = "\(myFilesPath)"
//First do block tries to get the file attributes and fails
do {
let fileAttributes = try FileManager.default.attributesOfItem(atPath: pathString)
print(fileAttributes)
let creationDate = (fileAttributes[FileAttributeKey.creationDate] as? NSDate)!
return daysBetweenDates(endDate: creationDate as Date) > 7
} …Run Code Online (Sandbox Code Playgroud) file-attributes ×10
delphi ×3
windows ×2
c# ×1
compression ×1
datetime ×1
delphi-2006 ×1
file ×1
inno-setup ×1
linux ×1
ls ×1
md5 ×1
mingw ×1
msys ×1
ntfs ×1
swift ×1
swift3 ×1
tar ×1
winapi ×1
xattr ×1