Wikipedia:Reference desk/Archives/Computing/2022 September 19

Computing desk
< September 18 << Aug | September | Oct >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


September 19

edit

Finding the "date created" of a file.

edit

When you copy/paste a file to another folder, the date created is now the date of the time you copy/pasted it... Then if you copy/paste that file back to the original folder, the date created is updated again... Anyone know of a way to retrieve the original date created? 67.165.185.178 (talk) 00:47, 19 September 2022 (UTC).[reply]

What operating system and filesystem are you using? Linux does not store any such "creation date" in its standard filesystems. Are you referring to Windows and NTFS? When you copy/paste a file, are you overwriting it? Deleting what was there before it? Moving to recycle bin? Elizium23 (talk) 01:01, 19 September 2022 (UTC)[reply]
Are you sure about Linux? This article lists a number of ways to find the file creation time in Linux, including simply using ls -l. According to the article, to see the last modification date, you need to use the -u option. I can't check whether this is accurate, and I don't know if all Linux implementations behave the same. Another article states it is only supported in the Ext4 filesystem but not easily accessed; one needs to resort to debugfs. Some versions of BSD do store the time of file creation; it can be found on freeBSD by using ls -cld <filename> and on macOS by using ls -Uld <filename>.[1]  --Lambiam 13:57, 19 September 2022 (UTC)[reply]
According to various discussions like [2] [3], since Linux kernel 4.1.11 it's possible to get the crtime via a standard kernel interface from file systems that support it. Nil Einne (talk) 16:05, 19 September 2022 (UTC)[reply]
I am not up to date with new features of Linux filesystems, but on traditional UNIX and on the Linux that I have, the creation time of a file is not recorded. The ctime (what ls -c reports) is the time that the inode was last modified. This may be the same as the time the file was created, but if (for example) you ever used chmod on it, then it'll be the time when you did that. --174.95.81.219 (talk) 20:14, 21 September 2022 (UTC)[reply]
But "Birth" is a new feature. "ctime" is the Change time (of the inode), not creation. For example (on an ext4 filesystem running under AlmaLinux 8.6):
           bash-4.4$ stat X
             File: X
             Size: 4096      	Blocks: 16         IO Block: 4096   directory
           Device: fd02h/64770d	Inode: 5254311     Links: 2
           Access: (0777/drwxrwxrwx)  Uid: ( NNNN/   XXXXX)   Gid: ( NNNN/   XXXXX)
           Access: 2022-09-20 18:45:16.543494121 +0100
           Modify: 2022-09-12 09:51:51.766360826 +0100
           Change: 2022-09-12 09:51:51.766360826 +0100
            Birth: 2022-08-18 11:09:42.958188770 +0100
Martin of Sheffield (talk) 21:20, 21 September 2022 (UTC)[reply]
When you copy a file (as opposed to moving it to a new location), you create a new file, then write the contents of the original to the new file. The access/modification/creation times (whichever are stored on the filesystem you use; it varies) can be set to those of the new file instead of those of the source if its contents. But some file copy tools, when used with the right options, allow you to choose. Further, in some file formats (in particular media files), the creation time is stored inside the file and in that case it's obviously copied over. This will typically (but not always) not be the timestamp displayed by your file manager, as that doesn't know how the find the creation time in every conceivable file format. PiusImpavidus (talk) 08:19, 19 September 2022 (UTC)[reply]

You know what I got this resolved somehow. I closed all the Explorer, reopened it, and right-clicked Properties (is a Microsoft Word document in Windows 7), and now the date created is back to what it was. I'm wondering now why I saw something different earlier. 67.165.185.178 (talk) 12:05, 19 September 2022 (UTC).[reply]

Air resistance

edit

Hey Pius I think you once said this to me in the Science desk: air drag increases with the square of velocity. If you increase velocity by 2, then drag increases by 4. So if you travel 41.4% faster, you consume twice the fuel per unit distance.

I found someone else post this on-line, was wondering if you're in agreement with: running car AC uses about 10% more fuel, but keeping windows open increasing drag increases 20% more fuel usage. Thanks. 67.165.185.178 (talk) 12:05, 19 September 2022 (UTC).[reply]

Running the AC increases fuel use, opening the windows increases fuel use too, but it's hard to give precise numbers. It depends on the model of the car, how far you open the windows, how hard the AC has to work, how fast you drive. Fuel use per hour of the AC should be fairly independent of speed (it may actually drop a bit with increasing speed, at least at temperatures where open windows work too), whilst fuel use per hour of open windows increases with the cube of speed (per unit distance it goes with the square, so per unit time with the cube), so I suppose that at low speed (in particular with a significant wind from the side) it's better to open your windows, but at medium or high speed it's better to use the AC. PiusImpavidus (talk) 08:07, 20 September 2022 (UTC)[reply]
  • (this should definitely be moved to the Science section)
It is approximately true that if you increase velocity by 2, then drag increases by 4. (though, as our article drag coefficient repeats multiple times, the drag coefficient is not entirely constant with speed). However, it does not follow that if you travel 41.4% faster, you consume twice the fuel per unit distance, because when the vehicle speed changes, that also changes the efficiency of its engine (= how much of the input energy is converted into mechanical motion of the wheel). See for instance this graph for an internal combustion engine. See also Propulsion_transmission#Automotive_basics - the whole reason that cars have a gear box is that you need more or less rotational speed and more or less torque in various conditions, and being able to convert between the two is extremely useful. That effect is also present (though to a lesser extent) with electrical vehicles. TigraanClick here for my talk page ("private" contact) 09:11, 20 September 2022 (UTC)[reply]
Would increased speed, increase or decrease the % of engine efficiency? 67.165.185.178 (talk) 02:12, 21 September 2022 (UTC).[reply]
The very general rule for gasoline (spark ignition) engines is that the optimal point is somewhere around the middle of the speed range and about the top of the load range (you go very quickly from "can run optimally" to "can run, but with severe restrictions on spark timing that degrade efficiency" to "cannot run without damage", due to engine knocking). The graph I linked to above is no exception: the optimal point of operation (in terms of fuel efficiency) is around 2700rpm of speed, 150bar of "torque" (= load, expressed as a mean effective pressure).
Note that the operating point is set by external conditions. If you keep the same transmission ratio, engine speed (in rpm) is simply proportional to vehicle speed (in km/h). The load is then given by how much friction etc. need to be overcome, which goes roughly as the square of the vehicle speed at high speeds. The driver has some amount of control over those (what you learn during driving lessons: switch gears at the appropriate time if you have a manual transmission, and drive slower if you can for better fuel economy). TigraanClick here for my talk page ("private" contact) 16:26, 22 September 2022 (UTC)[reply]