Why Sublime Text 2 doesn't updates folder's modification date? - sublimetext2

Here is a text file: test/foo.txt
When I use Sublime Text 2 to edit and save it, the 'test' folder's modification date doesn't change.
So if I want update the folder's date, need to run "touch test/" in Terminal. It drive me crazy.
Any way to do that automatically ?

The modification time of a directory will be updated only when a file is added, removed or renamed. Changing the content of the files in that directory simply won't trigger that.

You can change that on your preference file.
This is known as atomic save.
On your preference file, change it to:
"atomic_save": false
This will touch the file every time you save it.

Related

Is there a way to rename a file and upload it in all the others that call it?

I'm want to rename an html file in Visual Code, but this one is being called in several others. I want to know if there's a way to do this quickly. Some short cut that allows me to rename the file and instantle update this in the others .html .css or .js that calls it.
If it didn't update by itself, simply use the Replace in Files in the Edit (cmd-shift-r or ctrl-shift-r) and search for your old filename and replace with the new one. Include the extension if you included it in the code, that way you won't replace anything other than the filename. Also preview what will change before replacing everything.

chrome.filesystem: Rename a file and save it on the client's disk

How could I do with chrome.filesystem to rename a file and save it. For example, if my file is named myfile.txt I would rename the myfile.html and save it without using the saveAs function. And if that's not possible, do I have a solution.
The problem is that I have to save the file on the client's disk. So for me to use the filesystem functions can not be a solution, I have not seen that chrome.filesystem API that allows.
Thank you in advance! I'm a little discouraged. I also watched the browserify aside to work around the problem, but I have not found how to do it.
To rename a file you must have the ability to create a new file on the user's filesystem. You can get this permission by asking the user to open the whole directory in which the project exists. Then you can create any file you want within that directory by calling getFile with { create: true } on the resulting DirectoryEntry.
Edit: See this example for duplicating files selected by the user. Instead of using fs.root as is done here you can use the result of chrome.fileSystem.chooseEntry as the DirectoryEntry in which the file is saved.

How to BULK INSERT files that change name every day?

I have a folder that is static with a daily txt file that goes into the folder. The file name is the date. If the file name has the same name every day, everything works. Is there a way I can have my script pull any txt file in the folder? (Note, file comes in, get's processed and then I have an automatic transfer that moves the file after it has been inserted to a processed folder). So there will only be one file at a time in the folder. I hope that makes sense.
Here is the script for the bulk insert:
Bulk Insert Mydata.dbo.cust_adj
From 'C:\MyData\FlatFiles\UnprocessedAdjReport\importformat.txt'
With
(
FieldTerminator= '|',
Rowterminator= '\n'
)
Go
(I've got this saved as a stored procedure btw)
So "importformat" is just the name I used while setting up my scripts, going forward it will be in bb-yyyy-mmdd-hhmmnnnn.txt, as soon as the file is inserted, I move the file from the unprocessed folder to the processed folder. There will only be the one file each day.
If anyone has any advice or assistance with this, I would greatly appreciate it.
See the link it may be what you are looking for:
http://www.kodyaz.com/articles/how-to-extract-filename-from-path-using-sql-functions.aspx
Or
http://sqljourney.wordpress.com/2010/06/08/get-list-of-files-from-a-windows-directory-to-sql-server/
Or maybe
http://www.codeproject.com/Articles/38850/An-Easy-Way-to-Get-a-File-Name-or-a-File-Extension
HTH

Ignore specific line in files

My question is very similar to this one.
I have the files under Mercurial version control and each file have a string:
<modified-time>some time</modified-time>
This line have created the an external tool, and the tool change this line periodically. I don't want to know about changes in this line and want to ignore the changes in this line when I doing 'diff', 'commit' and 'status' commands.
So, if a file has only one change and the change is that line I need to skip this file in the output of 'hg status' command.
If the file has another changes in the other lines I need to get this file in the output of 'hg status' command.
If I commit the file I need to commit all the changes.
(UPDATE sorry to misread the question and mislead OP.)
If all your files are generated by the external tool, track the source files instead.
If not, and if you can modify the generator, make it use the date keyword as with the bundled keyword extension.
If not (OP's comment indicated so), you could use pre-* hooks to ignore the time change (when it's the only change). It'd be a pain, though, since you have to have a hook for every command that would see the file difference.
Or as OP's comment suggested, revert the file when it has only time change, either manually or automatically (on a timer or subscribe to file system notification).

SQLServer 2008 : Name of backup file

I have a SQL server 2008 and I would change the name of the backup file.
I use an SSIS package to perform my backups.
The file's name looks like
[DATABASE_NAME]_backup_YYYY_MM_DD_XXXXXX_XXXXXX
This is automatically generated by SqlServer, and I want to remove the "_".
How I can modify this ?
Thank you in advance,
Andy.
I have faced similar situation today and used following workaround.
Use "Execute Process Task" to rename the backup. I created a batch file with following command and executed it after the Database backup task.
ren BDNAME.bak DBNAME_%date:~-4,4%%date:~-7,2%%date:~4,2%.bak
Above command will rename DBNAME.bak file to DBNAME_yyyymmdd.bak
Keep the file in the same folder where you keep the backup file. In the Execute Process Task Editor, specify batch file name in the Executable property and the location of batch file in the WorkingDirectory property.
Hope it helps.
I believe that you can use the DestinationManualList for this, although I've never used it myself and I can't seem to find documentation or examples of it anywhere. It appears in the Properties list for the Backup Database Task, but not in the dialog for it.
I don't believe you can manual edit the DestinationManualList property. Right click on the task and select Edit. In the dialog that opens click on "Back up databases across one or more files" then click on the Add button. In the Select Backup Destination dialog click on File name and enter the path including the name and extension of the file. What you've entered will then show up in the DestinationManualList collection.