PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label delete-file. Show all posts
Showing posts with label delete-file. Show all posts

Wednesday, October 19, 2022

[FIXED] how can I delete file which has invalid file name?

 October 19, 2022     admin, delete-file, filenames, windows     No comments   

Issue

enter image description here

There is 2 loader.bin. But one of them has carrage return at the end of the file name. Because of this, I can't delete the file, and directory containing the file. Even with command prompt, I can't delete it. I tried:

del *
del loader.*

above says name or label is wrong. So I

cd ..
dir /x

to check DOS path name of the directory And delete with DOS path del TEXT_L~1 and again, above says name or label is wrong.

I also tried to delete the directory with "\?\" prefix. something like:

del "\\?\D:\directory\blahblah\directory"

and again, name error occurs.

How can I delete this file? Can I have some hint?

I guess that there is carriage return at the end of name because auto complete in git bash complete the name as "loader.bin^M"

I think the file came from wrong command from batch file like:

fasm file.asm loader.bin(here's carriage return)

(fasm is assembler program) Batch file's end of line may have been changed while I changed platform from linux to windows.

EDIT: The file refused to get deleted with following method too.

  1. delete with /P option

    del /P directoryName
    
  2. with DeleteFileW windows API

    #include <windows.h>
    int main()
    {
        DeleteFileW(L"E:\\directory\\blahblah\\directory");
    }
    

Solution

this problem never happened to me but maybe using del /P directory you could be able to remove the file.

Example

Update

You could use a live Linux distro and delete the file you need.

Thanks



Answered By - Alberto
Answer Checked By - David Goodson (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Sunday, July 10, 2022

[FIXED] How can I delete all unreferenced files in an Xcode project?

 July 10, 2022     delete-file, reference, xcode     No comments   

Issue

I added a bunch of files at different times to my project then later deleted them, and I forgot to make Xcode trash the files in addition to the references. Since Xcode doesn't store the grouped files in separate directories, I now have hundreds of files and folders all together in my project directory, and it would be a pain to sift through and take out the ones I don't want.

I'm using Xcode 5. How do I make it automatically delete all files in my project directory that aren't actually part of the project? Note: I am not referring to files referenced in my source code, just the Xcode project itself.

I had the idea of using the built-in git functionality to solve this by pushing the project to Github, deleting the local copy, then cloning it back. But apparently, removing referenced files in Xcode won't prevent them from being committed. If there's some option to make Xcode only include referenced files in the git repository, that would work too (even though it's a hack workaround).


Solution

AFAIK, there are no trivial way to find unreferenced files in an Xcode project.

I wrote a tool to do it though.



Answered By - Frizlab
Answer Checked By - Marie Seifert (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, March 28, 2022

[FIXED] Deleting a File using php/codeigniter

 March 28, 2022     codeigniter, delete-file, php, unlink     No comments   

Issue

I would like to delete a file that is found in my localhost.

localhost/project/folder/file_to_delete

I'm using codeigniter for this.

I would like to

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing