Filesystem Class: Paths, SIMPLIFIED

Pages: 12
I thought it would be prudent to have it try an operation at least twice before it went to a different method
See previous comment about definition of insanity.

If you want me to explain why, I'm sorry if I don't have an answer. Mabey the command line executes a different command with some arguments remove() doesn't use.
This is what makes voodoo programming a bad thing. You don't use something if you don't understand what (not how, what) it does.
It's just a slippery slope and it always ends up in sacrificing goats to placate the Computer's anger, who refuses to let our programs run without errors.

If a big phillips head doesn't work on a phillips head screw, should I give up because they are the same type or should I try the same screwdriver with a slightly different size?
This is an invalid analogy. Two Phillips screwdrivers of different sizes are different. What you're doing is more like trying with one screwdriver, then trying again with a second but identical screwdriver.

Is this wrong, then?
Isn't this what we've been saying all along?
If Boost is failing to delete a file but
del /f
succeeds then the file is probably read only. So the real question is can boost delete a read only file?
@naraku

I examined that, and a lot of read-only files were successfully deleted. read-only was my first thought when the exception was thrown, so I looked at the directory, and it's source (this was a directory that was copied, so there was another copy for me to look at for the files that were deleted) showed that the entire path was read-only. Hell, everything under the drive (with the exception of a few directories) is read-only. I don't know if this is windows 8 or what, but I do not believe I remember this being true for windows 7.

Read-only also seems to have no effect when dealing with the modification of files. This makes me wonder why the heck they even have the attribute turned on, so I turned it off, starting the "C:\Program Files", and what do you know, it wouldn't let me change it! I made sure I was pressing OK and APPLY, because I thought I did change the settings, and I checked the paths. Windows 8 wuld not let me modify the read-only attributes.

Then again, Windows 8 seems not to do a lot of things... (not in the least of which is let me modify my public/private networks)

The files that won't delete are few, and I can not determine why. This has actually been a problem since the conception of my backup program (which I have used to backup many 60-80 Gb backups reliably and successfully).
I recommend not basing your research on operating systems that were made by confused design teams that implemented multiple completely different and unrelated tedious ways to turn off the computer.
@LB

lol


I'm stuck with what I've got though... Can't buy a new computer.
-----------------------------------------------------------------------------------------------------------------

Anyway, I have updated the class:

deletion of files uses the API RemoveDirectory() function. So, there. As a backup, if that doesn't work, the option to use system() is still allowed.
I re-uploaded it with a small correction:

cmpilation error. sorry, it should work now.
lol, alright, I just did some tests on the modified code:

It copies an existing directory after creating a folder (with a folder inside to mix things up). Then it moves that entire thing onto my desktop. then it deletes it.

It pauses in between each operation to allow me to inspect the results.

I found somthing surprising: RemoveDirectory() is failing, where system() is not.

Are they the same? You tell me...

[EDIT]

Ah, I had to dig, because MSDN is wrong, but I found out that RemoveDirectory() only works when the directory is empty, so I will be updating the code in a bit.
Last edited on
ok, a stable version is up.
Ah, I had to dig, because MSDN is wrong, but I found out that RemoveDirectory() only works when the directory is empty, so I will be updating the code in a bit.


http://msdn.microsoft.com/en-us/library/windows/desktop/aa365488%28v=vs.85%29.aspx

First line of the description:

Deletes an existing empty directory.


It's not a very well kept secret.
aw how did I miss that! 0_0

Well, thanks for pointing that out, lol.
LB wrote:
I recommend not basing your research on operating systems that were made by confused design teams that implemented multiple completely different and unrelated tedious ways to turn off the computer.

That discounts Linux then:
1
2
3
halt
shutdown
telinit 0

And probably others. Also, only 'telinit 0' currently seems to work for me: if I use one of the other commands, the OS halts but the power stays on.
@chrisname those are multiple different unrelated ways, but they are not tedious.
chrisname wrote:
And probably others. Also, only 'telinit 0' currently seems to work for me: if I use one of the other commands, the OS halts but the power stays on.


I thought halt is for halting the CPU (not the OS), presumably before using poweroff.

Edit:
I also thought there was halt & poweroff assembly instruction. Maybe there was in the DOS 16bit assembly I did bleems ago.

shutdown. has a default of 1 minute before it does anything - I think this gives it a chance to issue shutdown warnings to other machines. There is the shutdown now plus other options for shutting down at a particular time.
Last edited on
@TheIdeasMan

How exactly would that work?

You halt the CPU, so then you can give the CPU an instruction to 'power off'? That doesn't even make sense...
@LB
What's tedious about the Windows way(s) (I assume you were talking about Windows)?

TheIdeasMan wrote:
I thought halt is for halting the CPU (not the OS), presumably before using poweroff.

I also thought there was halt & poweroff assembly instruction. Maybe there was in the DOS 16bit assembly I did bleems ago.

hlt is an x86 assembly instruction that tells the CPU to idle until the next interrupt comes (so you have to be very careful with how you place your cli (ignore interrupts) and hlt (wait until next interrupt) instructions, lest you write hlt after cli and hang the machine indefinitely). There isn't and has never been a poweroff instruction that I know of. Actually powering off the computer is surprisingly complicated. Even more ridiculous is that rebooting is incredibly simple:
1
2
3
4
5
6
7
8
void reboot()
{
    uint8_t good = 0x02;
    while (good & 0x02)
        good = inb(0x64);
    outb(0x64, 0xFE);
    halt();
}

http://wiki.osdev.org/Reboot
I don't know why it's done via the keyboard controller (port 0x64).

Compare with the code at http://forum.osdev.org/viewtopic.php?t=16990
Last edited on
chrisname wrote:
@LB
What's tedious about the Windows way(s) (I assume you were talking about Windows)?
Specifically Windows 8:
https://www.youtube.com/watch?v=Ohg_oBFKliI
In previous Windows versions there is one centralized way to turn off your computer and it is simple, not tedious.
Last edited on
closed account (1yR4jE8b)
It's in a different place that you need to learn once, and I'd hardly call 1 extra click for something you rarely do all that much "tedious". Big whoop. I swear, people rag on the tiniest most inconsequential details about Windows 8 but ignore all of the good things.
Oh really?

Yes, the GUI is different, but just about ALL the hoteys from all the previous versiona ar carried over.

(for the sake of simplicity, 'W' = [Windows Key])

for example:

W + 'D' = Desktop
CTRL + SHIFT + ESC = Task Manager

W = The 'start' screen (really a panel screen), which is the equivilant of the Start button on previous versions

W + 'R' = run
W + 'X' = a small list of Administrative tools

etc...

I used these hotkeys in W7, and I use them in W8.

What I find most irritating, though, is:

- W8 starts up to the 'Start Panel', where I would prefer to be at the desktop...
- W8 automatically starts some sort of messed up maintanence, without the user's knowledge, in the background. I went through a lot of trouble to eliminate this, and it still doesn't completely disable the retarded piece of crap.

- W8 seems to like to automatically run msexec.exe ALL THE TIME for no reason at all, and restarts it when you close it.

- W8 starts VSCS.exe (Virtual Shadow Copy System) for some reason, when you do certain things. This ticks me off to NO end...

- W8 charms bar is a pain in the ass, poping up if you put your mouse in the wrong spot ont the screen. This makes it irritating when trying to close a window.

I could go on, but the point is, it isn't the controls. It is they way those controls are emplemented in the GUI, and how the infernal OS works that makes it a piece of crap. I've had to live with it since christmas now...
Last edited on
^ this. Windows 8 is a pain.
Topic archived. No new replies allowed.
Pages: 12