filesystems

Any way to work around the PathTooLongException that FileSystemInfo.Fullname throws sometimes?

白昼怎懂夜的黑 提交于 2021-02-07 05:53:05
问题 I have files on my hard drive that throw a PathTooLongException when I access the Fullname property of a FileSystemInfo object. Is there any way around this (excluding renaming the files which is not an option)? http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#maxpath mentioned by other answers suggests putting a "\?\" prefix on the file name but in this case the DirectoryInfo.GetFileSystemInfos() is responsible for creating the FileSystemInfo objects and DirectoryInfo doesn't

fsync vs write system call

我的梦境 提交于 2021-02-07 03:38:23
问题 I would like to ask a fundamental question about when is it useful to use a system call like fsync. I am beginner and i was always under the impression that write is enough to write to a file, and samples that use write actually write to the file at the end. So what is the purpose of a system call like fsync? Just to provide some background i am using Berkeley DB library version 5.1.19 and there is a lot of talk around the cost of fsync() vs just writing. That is the reason i am wondering.

fsync vs write system call

主宰稳场 提交于 2021-02-07 03:36:17
问题 I would like to ask a fundamental question about when is it useful to use a system call like fsync. I am beginner and i was always under the impression that write is enough to write to a file, and samples that use write actually write to the file at the end. So what is the purpose of a system call like fsync? Just to provide some background i am using Berkeley DB library version 5.1.19 and there is a lot of talk around the cost of fsync() vs just writing. That is the reason i am wondering.

How do I exclude a folder when performing file operations i.e. cp, mv, rm and chown etc. in Linux

前提是你 提交于 2021-02-05 20:29:23
问题 How do you exclude a folder when performing file operations i.e. cp etc. I would currently use the wild card * to apply file operation to all, but I need to exclude one single folder. The command I'm actually wanting to use is chown to change the owner of all the files in a directory but I need to exclude one sub directory. 回答1: If you're using bash and enable extglob via shopt -s extglob then you can use !(<pattern>) to exclude the given pattern. 回答2: find dir_to_start -name dir_to_exclude

What is better ? Using a double backward slash ('\\') as file seperator or Files.seperator to remove O.S. Dependency while working with files in java

北慕城南 提交于 2021-02-05 07:00:43
问题 So i have made an application which performs some reading/writing to files. I want to make the Path Traversal as independent of O.S. Different operating systems use different characters as file separators. For example, Microsoft Windows systems use "\" , while UNIX systems use "/" . When applications have to run on different platforms, the use of hardcoded file separators can lead to incorrect execution of application logic. So i came up with using a double backward slash '\\' . But now i

FAT32: set long filename and 8.3 filename separately [closed]

空扰寡人 提交于 2021-02-04 21:35:21
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . Improve this question I need to construct a SDHC card (FAT32) with a directory where I have chosen the short and long filenames independently. E.g. short filename MYDIR but long name i am a cool name. yeah. check out the awesomeness. Based on Wikipedia, there is no mandatory correlation between the two names, so

How to Generate File of a determinate Size in Windows?

南楼画角 提交于 2021-02-04 03:15:55
问题 How is the Best and fastest way to do it? 回答1: PowerShell: $f = new-object System.IO.FileStream c:\temp\test.dat, Create, ReadWrite $f.SetLength(42MB) $f.Close() This will create a file c:\temp\test.dat that consists of 42MB of nullbytes. You can of course just give byte count instead as well. (42MB = 42 * 1048576 for PowerShell) 回答2: I found this Page, I try it and work great. To create a single File use fsutil file createnew filename filesize To create a lot of Files use For /L %i in (1,1

How to Generate File of a determinate Size in Windows?

南楼画角 提交于 2021-02-04 03:15:46
问题 How is the Best and fastest way to do it? 回答1: PowerShell: $f = new-object System.IO.FileStream c:\temp\test.dat, Create, ReadWrite $f.SetLength(42MB) $f.Close() This will create a file c:\temp\test.dat that consists of 42MB of nullbytes. You can of course just give byte count instead as well. (42MB = 42 * 1048576 for PowerShell) 回答2: I found this Page, I try it and work great. To create a single File use fsutil file createnew filename filesize To create a lot of Files use For /L %i in (1,1

How to Generate File of a determinate Size in Windows?

偶尔善良 提交于 2021-02-04 03:14:35
问题 How is the Best and fastest way to do it? 回答1: PowerShell: $f = new-object System.IO.FileStream c:\temp\test.dat, Create, ReadWrite $f.SetLength(42MB) $f.Close() This will create a file c:\temp\test.dat that consists of 42MB of nullbytes. You can of course just give byte count instead as well. (42MB = 42 * 1048576 for PowerShell) 回答2: I found this Page, I try it and work great. To create a single File use fsutil file createnew filename filesize To create a lot of Files use For /L %i in (1,1

How to Generate File of a determinate Size in Windows?

依然范特西╮ 提交于 2021-02-04 03:14:29
问题 How is the Best and fastest way to do it? 回答1: PowerShell: $f = new-object System.IO.FileStream c:\temp\test.dat, Create, ReadWrite $f.SetLength(42MB) $f.Close() This will create a file c:\temp\test.dat that consists of 42MB of nullbytes. You can of course just give byte count instead as well. (42MB = 42 * 1048576 for PowerShell) 回答2: I found this Page, I try it and work great. To create a single File use fsutil file createnew filename filesize To create a lot of Files use For /L %i in (1,1