Premise
I was not able to give a proper title to the question, please help if you can improve it. I would also like some help with tags.
Question
I'm in MATLAB (Win 8.1) trying to read files from another hard disk, which is a HFS+ drive with OSX.
for k = 1:10000 //%lot of files
load(['D:\Users\user\Desktop\mats\Some file à',num2str(k),'.mat'])
end
Console says that files are not really there, but I know they are. After some time I got the problem resides in the à charachter, that is present in every single filename.
If I go:
cd('D:\Users\user\Desktop\mats\');
ls
I see that the à character is seen by Windows as a simple a followed by a backtick, a`. However, if I call
load('D:\...\Some file a`.mat)
It doesn't work either. Is there something I can to to bypass this problem? I can't load and rename each file because, well, I can't read them. And I would avoid logging into the OSX drive, since it does not belong to me and would bring non-programming, but annoying, issues.
Any ideas, or notions about how characters are converted from OS to OS?
Edit
I add that I know files are there because there is One lucky file.mat that has no à whatsoever, and I can easily load it. With help from #horchler in comments I verified that, for à files, MATLAB refuses the filenames it just listed out, which looks totally weird to me.
Related
Basically I need to download a .txt file to my teachers macbook saying something along the lines of "I was here" including my name & student ID.
If I can manage to do this I instantly pass the security class.
For those of you who want to hear (or read) the story, read the following paragraph, for the rest just skip it.
My teacher from my Computer Security class has given everyone a challenge, the one who leaves a txt file saying you were here on his macbook's desktop will instantly pass the class. He usually keeps an eye on his macbook and if you want access to it you'd have to steal it without him seeing you do it. His disk is encrypted and he has long passwords. I have thought about a few approaches and I want to get as much information on each approach as possible. First approach was simply hanging a recorder somewhere in the room to record him typing in his password then stealing his mac and creating the txt file. Second approach was somehow getting him to run a file that would create said txt file. And third approach is basically injecting javascript code into his sites which silently download the txt file to his desktop. Now I just need to know if it's even possible to silently download said file.
So here we finally come to the question, is there a way of silently downloading a txt file, and if so how would one do it?
And if it isn't possible, does anyone have any ideas for me to place the txt file on his pc?
EDIT: For those of you wondering, its uni/college not some kind of preschool.
Well, Have you performed any scans on this particular macbook? Do they host any services, like a web server or other service from this machine? That would be the traditional starting point.
Otherwise, Social Engineering, is probably the best way forward. You could pull off the student version of what happened to Ross Ulbricht. Wait for them to log into the machine. Then get some of your mates to create a significant distraction. Download and execute a quick executable that places your "proof" on the desktop (Or just be a quick typist) Profit.
Alternately:
Create a malicious executable.
Change the icon of executable to look like a word document.
Name Executable "Love Letter" or something juicy.
Place the executable on Flash Drive.
Place 5-10 "Boring" useless, normal files on there too. 2-3 pictures. (Just to get his guard down)
Leave this flash drive on or (Preferably near) his desk.
Wait.
This executable should create the text file on the desktop, pop up a smug message, Take a screenshot, and email both you and him the picture as proof.
The executable should also be designed to no longer work after a certain amount of time.
I tried to install windows7 from USB according to the instructions of following page.
http://www.intowindows.com/how-to-install-windows-7vista-from-usb-drive-detailed-100-working-guide/
But at the location where i select the partition it says me something like "device not found."(Cant give the exact machine as i came to somewhere else to search the internet, coz my machine's not working).
How can i overcome this?? I've formatted the whole disk. Got nothing to do now!!!
You have formatted the whole hard disk. That is the problem. It's a windows 7 specific problem. I'll describe the case in brief. the setup detects your pen drive as a part of the hard disk(at least something like this). Therefore you can overcome the issue by not letting this to happen.
Which means, you can make the pen drive read only (or make don't allow setup to use pen drives storage). One possible solution will be fill the empty space of the pen drive with bulky data. then there will be no space for the setup program to use in the pen.
Or else you can remove pen drive at the time where the setup is trying to access it (for the above mentioned purpose). How to know the exact time??? well it's trial and error. I myself have done it and it worked. It will require some Patience.
Of course, you can install some other os and then try install win7 after that.
Hope that helps..!!
I store the MRU of logins to my application in a file called login.ini and I save it in widnows application folders.
I noticed that on some systems — I don't know why; I cannot find a common cause — the user cannot create the file, whereas it creates all other files in the same folder.
The only reason I can think of is that some antivirus/windows setting/... doesn't allow this particular user to create the file on this system.
I solved the problem by renaming the file and it seems ok, but I'd like to be sure. Does anyone know more?
Note for bounty:
This is a related question I asked that details a little more what I am doing.
A little Google-fu turns up that other Windows developers have sucessfully created login.ini for their programs, and others use it in a third-party Windows login management program, so I would expect that its "reservedness" is partially dependent on its location in the file system (i.e. in the system files). However, I don't think the name "login.ini" is a system-wide reserved name, no.
I think you're right - certain antivirus programs MAY be messing with the creation of that file, as it is a fairly likely candidate imho for a virus filename. It looks as if it may already have been used for that purpose somewhere (apparently outside of the US), tho don't quote me on that.
So, if a different name works for you, I'd go with that. :)
Anti-virus is a definite possibility for messing with your file. Stuff like that happened all the time to me when I was using Norton.
'login.ini' is not a system-wide reserved name, it would only mess things up with the OS if you had it in the (assuming your drive is C:) C:\WINDOWS or C:\WINDOWS\System32 directories.
If you just have the file in an application files directory (like C:\Program Files or C:\All Users\Application Settings and such) it shouldn't interfere with the system.
If you determine that anti-virus is a definite problem, you could change the name to something like loginData and maybe make up a new file extension if you want to (assuming you are just going to read the file from a program, where the extension doesn't matter. otherwise stick to a recognized file extension)
I have a build script where i create a text report file and output various log type stuff to it. The data is all being built onto an external hd which (according to 'mount') has file format "fuseblk" (which i've never heard of).
The building all seems to work ok but my report files are being saved as executables, which linux interprets as SOR files. I'd like them to just be regular text files, openable by default in my regular text editor.
I'm making the file, and writing to it, like this:
#report = File.open(File.join(DESTINATION_BUILD_FOLDER, "#{title.folder_name}_report.txt"),"w")
...
s = "making modules folder inside resource_library folder";puts s; #report.puts s
...
#report.close
I've done this lots of times before and never encountered this problem. Any ideas anyone?
cheers, max
ps i know that i can edit the saved files to make them non-executable, my question is 'why is this happening in the first place?'. Cheers :)
I don't think there's anything wrong with your program. The fuseblk just means it's being mounted through FUSE, which allows filesystem drivers to run as userspace programs, instead of kernel modules. Most likely, the filesystem is NTFS or FAT32.
The problem here is that Linux is assuming everything on the drive has the execute bit set. This is because neither NTFS nor FAT32 have the capability to store Linux permission bits (NTFS has a very different permissions system, FAT32 has virtually none). And I bet you're trying to double-click on the log files in something like the gnome file explorer, right?
Well, go there with the command line and use less or your favorite command-line editor to view them. Or right click on them in the file explorer, or open them with File -> Open from a text editor. If you ask your question to people who know Gnome (or KDE?) better, you'll probably get a better answer.
I've asked the very same question here :
Why does my program say "folder does not exist" when run on Windows 2008?
but none of the answers were satisfying and my problem still exists , so I decide to ask it in another way with more detail cause this problem really irritate me and we need to solve this , otherwise we have to write the similar application in another language which means waste of our time.
program written in delphi 7(32 bit)
environment running this program is : windows 2008 r2 64-bit
the task program try to do : creating 3 folders then copy an sound file and compress it using lame commmand line (lame.exe) and save changes into database
error I get : "THE 'folder' does not exist . the file might have been moved or deleted , Do you want to create it?" and it cause the program become halted
things I have done :
1- try to run the program as an administrator
2- check eventlog but no clue
3- triple check the required folder and all of them was correct
4- read this KB: http://support.microsoft.com/kb/927387
BUT still I am seeing this bloody error.
I have uploaded the picture of the error here as you see it clearly :
http://i28.tinypic.com/9to6qr.jpg
The folder name is C:\Upload_ABC\\2010\07\27\:
please notice I haven't written that unwanted dialog-box inside my program I believe windows 2008 attach it or bring it on my application.
please please please give me some idea or let me know what should I do ?
best regards.
C:\Upload_ABC\\2010\07\27\
You have two backslashes in your path. Use debugger to see why.
Have you checked the access rights for that folder structure with regard to the account the Delphi program is running from? Windows Server systems tend to be more restrictive in what a user is allowed to do than Windows on workstations are.
In addition I suggest to strip down a copy of the program to the relevant functionality to show the error. With this you get at least a chance that anyone around may test it on another system.
Furthermore you can try to compile it with D2010 and see wether the error persists. If it does, you might have a chance to find the problem running the D2010 debugger. If you don't have D2010 at hand, you might install the trial just for this purpose.
What is between the two consecutive backslashes in your path? Is there really nothing between them or have some characters been removed because they are Unicode and D7 doesn't support Unicode?
As there is nothing in between the two consecutive backslashes...
It does sound like Windows is getting its grubby little fingers in between your program and your access of the files. Either the folders have not been created, or you are being denied access once they have. And as the changes you are trying to store in your database involve compressed files, virtualization seems to be the culprit as explained by the link you yourself provided.
A couple of avenues to try:
Remove any compatibility settings on your exe (right click|properties|Compatibility tab) that could trigger Windows to butt in. Also don't forget this can be triggered by things like "setup" or "update" as part of the executable name.
"Save your application's data in a folder under your user profile."
Such as c:\users\\documents or some such (better not hardcode it in actual production code, but ok for debugging). That after all is exactly the advice the linked msdn article is giving for scenario 2 "you cannot find the files or folders you just created"
If you can't debug on the machine where it is running, go back to old school debugging: add trace messages to your code to show where in the code you are (and have been) and show them in a memo on a separate form or some such.
Make sure you don't "eat" any exceptions that could give you extra information about what is going on.